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
This commit is contained in:
jottley 2012-08-17 17:21:10 +00:00
parent cccc2201e0
commit e76e42865a

View File

@ -31,13 +31,13 @@ public class AmpProjectPackagingTask
extends AbstractAmpPackagingTask extends AbstractAmpPackagingTask
{ {
private static final String MODULE_PROPERTIES = "module.properties"; 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 WEB_PATH = "web/";
private static final String CONFIG_PATH = "config/"; 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"; "/web/WEB-INF=/WEB-INF\n";
@ -78,7 +78,7 @@ public class AmpProjectPackagingTask
handeWebAppSourceDirectory( context ); handeWebAppSourceDirectory( context );
synthesiseFileMappings(context); synthesiseFileMapping(context);
// Notice: this will work only in case we are copying only this AMP or this AMP is // 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. * get written to the correct location by the MMT.
* *
* @param context The packaging context * @param context The packaging context
* @throws MojoExecutionException if the file could not be created * @throws MojoExecutionException if the file could not be created
*/ */
protected void synthesiseFileMappings(final AmpPackagingContext context) protected void synthesiseFileMapping(final AmpPackagingContext context)
throws MojoExecutionException throws MojoExecutionException
{ {
try try
{ {
File fileMappings = new File(context.getAmpDirectory(), FILE_MAPPINGS); File fileMapping = new File(context.getAmpDirectory(), FILE_MAPPING);
OutputStream out = null; 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 try
{ {
out = new FileOutputStream(fileMappings, false); out = new FileOutputStream(fileMapping, false);
out.write(FILE_MAPPINGS_CONTENT.getBytes()); out.write(FILE_MAPPING_CONTENT.getBytes());
} }
finally finally
{ {
@ -189,7 +189,7 @@ public class AmpProjectPackagingTask
} }
catch (final IOException ioe) 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);
} }
} }