if ( !createEmpty )
{
return true;
}
ZipOutputStream zOut = null;
try
{
getLogger().debug( "Building MANIFEST-only jar: "
+ getDestFile().getAbsolutePath() );
zOut = new ZipOutputStream( new FileOutputStream( getDestFile() ) );
zOut.setEncoding( getEncoding() );
if ( isCompress() )
{
zOut.setMethod( ZipOutputStream.DEFLATED );
}
else
{
zOut.setMethod( ZipOutputStream.STORED );
}
initZipOutputStream( zOut );
finalizeZipOutputStream( zOut );
}
catch ( IOException ioe )
{
throw new ArchiverException( "Could not create almost empty JAR archive"
+ " (" + ioe.getMessage() + ")", ioe );
}
finally
{
// Close the output stream.
try
{
if ( zOut != null )
{
zOut.close();
}
}
catch ( IOException ex )
{
}