PR: MNG-642

add getters/setters for all fields so they can be programmatically manipulated.
convert to native types rather than using strings.

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@225504 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-07-27 12:48:52 +00:00
parent 5d46a03299
commit ee4e4bc629
2 changed files with 31 additions and 18 deletions

View File

@ -16,6 +16,8 @@ package org.apache.maven.archiver;
* limitations under the License.
*/
import java.io.File;
/**
* Capture common archive configuration.
*
@ -25,34 +27,25 @@ package org.apache.maven.archiver;
*/
public class MavenArchiveConfiguration
{
/**
* @todo boolean instead
*/
private String compress;
private boolean compress = true;
/**
* @todo boolean instead
*/
private String index;
private boolean index;
/**
* @todo File instead
*/
private String manifestFile;
private File manifestFile;
private ManifestConfiguration manifest;
public boolean isCompress()
{
return compress != null ? Boolean.valueOf( compress ).booleanValue() : true;
return compress;
}
public boolean isIndex()
{
return index != null ? Boolean.valueOf( index ).booleanValue() : false;
return index;
}
public String getManifestFile()
public File getManifestFile()
{
return manifestFile;
}
@ -65,4 +58,24 @@ public class MavenArchiveConfiguration
}
return manifest;
}
public void setCompress( boolean compress )
{
this.compress = compress;
}
public void setIndex( boolean index )
{
this.index = index;
}
public void setManifestFile( File manifestFile )
{
this.manifestFile = manifestFile;
}
public void setManifest( ManifestConfiguration manifest )
{
this.manifest = manifest;
}
}

View File

@ -249,11 +249,11 @@ public class MavenArchiver
// Create the manifest
// ----------------------------------------------------------------------
String manifestFile = archiveConfiguration.getManifestFile();
File manifestFile = archiveConfiguration.getManifestFile();
if ( manifestFile != null && !"".equals( manifestFile ) )
if ( manifestFile != null )
{
archiver.setManifest( new File( manifestFile ) );
archiver.setManifest( manifestFile );
}
Manifest manifest = getManifest( project, archiveConfiguration.getManifest() );