The following will cause NullPointerException:
archiver.setDestFile( new File( "archive.zip" ) );
That is because setDestFile tries to create the parent directory:
if ( destFile != null )
{
destFile.getParentFile().mkdirs();
}
but in the case shown above destFile.getParentFile() returns null.
The following will cause
NullPointerException:That is because
setDestFiletries to create the parent directory:but in the case shown above
destFile.getParentFile()returnsnull.