manifest = getManifest( file );
}
}
catch ( UnsupportedEncodingException e )
{
throw new ArchiverException( "Unsupported encoding while reading "
+ "manifest: " + e.getMessage(), e );
}
}
else if ( ( filesetManifestConfig != null )
&& !filesetManifestConfig.getValue().equals( "skip" ) )
{
// we add this to our group of fileset manifests
getLogger().debug( "Found manifest to merge in file " + file );
try
{
Manifest newManifest;
if ( is != null )
{
Reader reader;
if ( manifestEncoding == null )
{
reader = new InputStreamReader( is );
}
else
{
reader = new InputStreamReader( is, manifestEncoding );
}
newManifest = getManifest( reader );
}
else
{
newManifest = getManifest( file );
}
if ( filesetManifest == null )
{
filesetManifest = newManifest;
}
else
{
filesetManifest.merge( newManifest );
}
}
catch ( UnsupportedEncodingException e )
{
throw new ArchiverException( "Unsupported encoding while reading manifest: " + e.getMessage(), e );
}
catch ( ManifestException e )
{
getLogger().error( "Manifest in file " + file + " is invalid: " + e.getMessage() );
throw new ArchiverException( "Invalid Manifest", e );
}
}
}