From 11b56cc9128799097f6c67a2ea5bc06454731d85 Mon Sep 17 00:00:00 2001 From: Ariel Backenroth Date: Wed, 23 Aug 2006 22:03:56 +0000 Subject: [PATCH] strip extension from filename git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3594 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/java/org/alfresco/web/templating/OutputUtil.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/java/org/alfresco/web/templating/OutputUtil.java b/source/java/org/alfresco/web/templating/OutputUtil.java index 67ca810d8a..d318aa8fe5 100644 --- a/source/java/org/alfresco/web/templating/OutputUtil.java +++ b/source/java/org/alfresco/web/templating/OutputUtil.java @@ -58,6 +58,11 @@ public class OutputUtil private static final String PARENT_AVM_PATH = "repo-1:/repo-1/alice/appBase/avm_webapps/ROOT/home-insurance"; + private static String stripExtension(String s) + { + return s.replaceAll("(.+)\\..*", "$1"); + } + public static void generate(NodeRef createdNode, Document xml, TemplateType tt, @@ -71,7 +76,7 @@ public class OutputUtil try { // get the node ref of the node that will contain the content - fileName = fileName + "-generated.html"; + fileName = stripExtension(fileName) + ".html"; FileInfo fileInfo = fileFolderService.create(containerNodeRef, fileName,