ch.elca.dependency.util
Class UnZip
java.lang.Object
|
+--ch.elca.dependency.util.UnZip
- public class UnZip
- extends java.lang.Object
This helper class is used to extract jar archives into the specified
directory.
It creates the same relative directory structure in the specified output
directory as it is in the jar archive.
- Version:
- 1.0-beta
- Author:
- Christoph Trutmann
Constructor Summary |
UnZip()
|
Method Summary |
protected void |
buildDirectory(java.lang.String entryName)
Creates the directory structure |
void |
extractFiles(java.io.File zipFile,
java.io.File output)
Extracts the files contained in the zipped file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DATA_BLOCK_SIZE
protected final int DATA_BLOCK_SIZE
- Data block size.
- See Also:
- Constant Field Values
UnZip
public UnZip()
extractFiles
public void extractFiles(java.io.File zipFile,
java.io.File output)
- Extracts the files contained in the zipped file.
The basic steps are:
1. get the zipped input stream
2. get the zipped entries and determine output location
3. prepare the uncompressed output stream
4. read source zipped data and write to uncompressed stream
5. close the source and target stream
- Parameters:
zipFile
- Abstract file object of the zip file.output
- Output location for the extracted files.
buildDirectory
protected void buildDirectory(java.lang.String entryName)
throws java.io.IOException
- Creates the directory structure
java.io.IOException
Copyright © 2003 ELCA Informatique SA. All Rights Reserved.