de.smartics.maven.plugin.buildmetadata.io
Class BuildPropertiesFileHelper

Package class diagram package BuildPropertiesFileHelper
java.lang.Object
  extended by de.smartics.maven.plugin.buildmetadata.io.BuildPropertiesFileHelper

public final class BuildPropertiesFileHelper
     
     
extends Object

Helper to handle the build meta data properties file.

Author:
Robert Reiner

Constructor Summary
BuildPropertiesFileHelper(Log log, File propertiesOutputFile)
          Default constructor.
 
Method Summary
 Properties getProjectProperties(MavenProject project)
          Fetches the project properties and if null returns a new empty properties instance that is associated with the project.
 void readBuildPropertiesFile(Properties buildMetaDataProperties)
          Reads the build properties file from stream.
 File writePropertiesFile(Properties buildMetaDataProperties)
          Writes the build meta data properties to the target file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildPropertiesFileHelper

public BuildPropertiesFileHelper(Log log,
                                 File propertiesOutputFile)
Default constructor.

Parameters:
log - the logger to use.
propertiesOutputFile - the file to write to.
Method Detail

writePropertiesFile

public File writePropertiesFile(Properties buildMetaDataProperties)
                         throws MojoExecutionException
Writes the build meta data properties to the target file.

Parameters:
buildMetaDataProperties - the properties to write.
Returns:
the reference to the written file.
Throws:
MojoExecutionException - on any problem encountered while writing the properties.

readBuildPropertiesFile

public void readBuildPropertiesFile(Properties buildMetaDataProperties)
                             throws MojoExecutionException
Reads the build properties file from stream. The properties file is passed to this instance via the constructor propertiesOutputFile.

Parameters:
buildMetaDataProperties - the properties instance to append the read properties to.
Throws:
MojoExecutionException - if the properties cannot be read.

getProjectProperties

public Properties getProjectProperties(MavenProject project)
Fetches the project properties and if null returns a new empty properties instance that is associated with the project.

Parameters:
project - the project whose properties are requested.
Returns:
the properties of the project.


Copyright © 2006-2012 Kronseder & Reiner GmbH - smartics. All Rights Reserved.