wt.step
Class ZipStepPackager
java.lang.Object
wt.step.StepPackager
wt.step.ZipStepPackager
- public class ZipStepPackager
- extends StepPackager
StepPackage generator using the Zip format.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ZipStepPackager
public ZipStepPackager()
getPackageFileExtension
public String getPackageFileExtension()
- Specified by:
getPackageFileExtension
in class StepPackager
createPackage
public void createPackage(File zipFile,
File contentDir,
boolean includeDirectory,
boolean deleteAsAdded)
throws FileNotFoundException,
IOException
- Zip up a directory in to a single zip file
- Specified by:
createPackage
in class StepPackager
- Parameters:
includeDirectory
- If true then the given directory is also added to
the zip file and all files are rooted from that
directory.deleteAsAdded
- Delete files so that they are 'moved' into the
zip file.
- Throws:
FileNotFoundException
IOException
writeDirectoryContent
private void writeDirectoryContent(ZipOutputStream ostream,
int rootPathIndex,
File contentDir,
boolean deleteAsAdded)
throws FileNotFoundException,
IOException
- Throws:
FileNotFoundException
IOException
listPackageContents
public String[] listPackageContents(InputStream istream,
boolean ignoreDirectories)
throws IOException
- Specified by:
listPackageContents
in class StepPackager
- Throws:
IOException
listContents
private Vector listContents(InputStream zipFile,
boolean ignoreDirectories)
throws ZipException,
IOException
- Lists the names of all Zip Entries in a 'zip' stream.
- Throws:
ZipException
IOException
extractPackage
public void extractPackage(InputStream istream,
File baseDir)
throws IOException,
FileNotFoundException
- Specified by:
extractPackage
in class StepPackager
- Throws:
IOException
FileNotFoundException