From e76e42865a646f1c968607d261f69dc7fa83fb1c Mon Sep 17 00:00:00 2001 From: jottley Date: Fri, 17 Aug 2012 17:21:10 +0000 Subject: [PATCH] Issue 97 http://code.google.com/p/maven-alfresco-archetypes/issues/detail?id=97. Rename variables and methods to use mapping instead of mappings. Rename file-mappings.properties string to file-mapping.properties. git-svn-id: http://maven-alfresco-archetypes.googlecode.com/svn/trunk@492 04253f4f-3451-0410-a141-5562f1e59037 --- .../packaging/AmpProjectPackagingTask.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/maven-amp-plugin/src/main/java/org/alfresco/maven/plugin/amp/packaging/AmpProjectPackagingTask.java b/plugins/maven-amp-plugin/src/main/java/org/alfresco/maven/plugin/amp/packaging/AmpProjectPackagingTask.java index 2246cfb1..962000b5 100644 --- a/plugins/maven-amp-plugin/src/main/java/org/alfresco/maven/plugin/amp/packaging/AmpProjectPackagingTask.java +++ b/plugins/maven-amp-plugin/src/main/java/org/alfresco/maven/plugin/amp/packaging/AmpProjectPackagingTask.java @@ -31,13 +31,13 @@ public class AmpProjectPackagingTask extends AbstractAmpPackagingTask { private static final String MODULE_PROPERTIES = "module.properties"; - private static final String FILE_MAPPINGS = "file-mappings.properties"; + private static final String FILE_MAPPING = "file-mapping.properties"; private static final String WEB_PATH = "web/"; private static final String CONFIG_PATH = "config/"; - private static final String FILE_MAPPINGS_CONTENT = "# Add mapping for /WEB-INF/, since MMT doesn't support it by default\n" + + private static final String FILE_MAPPING_CONTENT = "# Add mapping for /WEB-INF/, since MMT doesn't support it by default\n" + "/web/WEB-INF=/WEB-INF\n"; @@ -78,7 +78,7 @@ public class AmpProjectPackagingTask handeWebAppSourceDirectory( context ); - synthesiseFileMappings(context); + synthesiseFileMapping(context); // Notice: this will work only in case we are copying only this AMP or this AMP is @@ -156,27 +156,27 @@ public class AmpProjectPackagingTask /** - * Synthesizes (creates) a standard file-mappings.properties file so that resources in webapp/WEB-INF + * Synthesizes (creates) a standard file-mapping.properties file so that resources in webapp/WEB-INF * get written to the correct location by the MMT. * * @param context The packaging context * @throws MojoExecutionException if the file could not be created */ - protected void synthesiseFileMappings(final AmpPackagingContext context) + protected void synthesiseFileMapping(final AmpPackagingContext context) throws MojoExecutionException { try { - File fileMappings = new File(context.getAmpDirectory(), FILE_MAPPINGS); + File fileMapping = new File(context.getAmpDirectory(), FILE_MAPPING); OutputStream out = null; - fileMappings.createNewFile(); // Note: ignore if the file already exists - we simply overwrite its existing contents + fileMapping.createNewFile(); // Note: ignore if the file already exists - we simply overwrite its existing contents try { - out = new FileOutputStream(fileMappings, false); + out = new FileOutputStream(fileMapping, false); - out.write(FILE_MAPPINGS_CONTENT.getBytes()); + out.write(FILE_MAPPING_CONTENT.getBytes()); } finally { @@ -189,7 +189,7 @@ public class AmpProjectPackagingTask } catch (final IOException ioe) { - throw new MojoExecutionException("Could not create file-mappings.properties in [" + context.getAmpDirectory().getAbsolutePath() + "]", ioe); + throw new MojoExecutionException("Could not create file-mapping.properties in [" + context.getAmpDirectory().getAbsolutePath() + "]", ioe); } }