public class ZipExploder extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
sortNames |
protected boolean |
verbose |
Constructor and Description |
---|
ZipExploder()
create a zip exploder for unpacking .jar/.zip files
|
ZipExploder(boolean verbose)
create a zip exploder for unpacking .jar/.zip files onto the file system
|
ZipExploder(boolean verbose,
boolean sorted)
create a zip exploder for unpacking .jar/.zip files onto the file system
|
Modifier and Type | Method and Description |
---|---|
protected void |
copyFileEntry(String destDir,
boolean destIsDir,
String destFile,
DataInputStream dis) |
void |
copyFileEntry(String destDir,
ZipFile zf,
ZipEntry ze)
copy a single entry from the archive
|
protected Map<String,ZipEntry> |
getEntries(ZipFile zf)
Get all the entries in a ZIP file.
|
boolean |
getSortNames() |
boolean |
getVerbose()
Get the verbose mode state.
|
static void |
main(String[] args)
Main command line entry point.
|
protected void |
print(String s) |
protected static void |
printHelp()
Print command help text.
|
void |
process(String[] zipNames,
String[] jarNames,
String destDir)
Explode source JAR and/or ZIP files into a target directory
|
void |
processFile(String zipName,
String destDir)
Explode source ZIP or JAR file into a target directory
|
void |
processJars(String[] jarNames,
String destDir)
Explode source JAR files into a target directory
|
void |
processZips(String[] zipNames,
String destDir)
Explode source ZIP files into a target directory
|
protected byte[] |
readAllBytes(DataInputStream is)
Read all the bytes in a ZIPed file
|
protected static void |
reportError(String msg) |
void |
setSortNames(boolean sortNames) |
void |
setVerbose(boolean f)
set the verbose mode state
|
public ZipExploder()
public ZipExploder(boolean verbose)
verbose
- - set to true
for verbose modepublic ZipExploder(boolean verbose, boolean sorted)
verbose
- - set to true
for verbose modesorted
- - set to true
for sorted file modepublic boolean getVerbose()
public void setVerbose(boolean f)
f
- - verbositypublic boolean getSortNames()
public void setSortNames(boolean sortNames)
sortNames
- The sortNames to set.public void process(String[] zipNames, String[] jarNames, String destDir) throws IOException
zipNames
- names of source filesjarNames
- names of source filesdestDir
- target directory name (should already exist)IOException
- error creating a target filepublic void processJars(String[] jarNames, String destDir) throws IOException
jarNames
- names of source filesdestDir
- target directory name (should already exist)IOException
- error creating a target filepublic void processZips(String[] zipNames, String destDir) throws IOException
zipNames
- names of source filesdestDir
- target directory name (should already exist)IOException
- error creating a target filepublic void processFile(String zipName, String destDir) throws IOException
zipName
- names of source filedestDir
- target directory name (should already exist)IOException
- error creating a target filepublic void copyFileEntry(String destDir, ZipFile zf, ZipEntry ze) throws IOException
destDir
- zf
- ze
- IOException
protected void copyFileEntry(String destDir, boolean destIsDir, String destFile, DataInputStream dis) throws IOException
IOException
protected byte[] readAllBytes(DataInputStream is) throws IOException
IOException
protected void print(String s)
protected static void printHelp()
protected static void reportError(String msg)
public static void main(String[] args)
args
- Copyright © 2006–2016 OPS4J - Open Participation Software for Java. All rights reserved.