@NotThreadSafe public class Nzip extends Application
cat, cp, rm, mkdir,
rmdir, ls etc.).
Please note that TrueZIP is designed for optimum performance.
However, this utility features some optional archive drivers which
provide additional safety or otherwise unavailable features.
Some of these drivers are not used in their default configuration -
see TArchiveDetector for more
information.
For example, the ZIP drivers used in this utility always check
the CRC-32 values provided in the ZIP file.
In addition, the SFX driver is used which allows you to browse
.exe files if they happen to be SelF eXtracting archives (SFX).
If they are not however, TrueZIP may spend some considerable amount of
time searching for the Central Directory required to be present in ZIP
(and hence SFX) files.
As a conclusion, this utility should not serve as a performance benchmark.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Nzip.IllegalUsageException |
| Modifier and Type | Field and Description |
|---|---|
private DateFormat |
dateFormat |
private FieldPosition |
fpos |
private NumberFormat |
numberFormat |
private static de.schlichtherle.truezip.socket.IOPoolProvider |
POOL_PROVIDER |
private static ResourceBundle |
resources |
err, out| Constructor and Description |
|---|
Nzip() |
| Modifier and Type | Method and Description |
|---|---|
private void |
align(StringBuffer buf,
long number,
int spacing) |
private void |
cat(String[] args) |
private void |
compact(String[] args) |
private void |
cpOrMv(String[] args,
boolean mv) |
private boolean |
exists(String[] args) |
private boolean |
isArchive(String[] args) |
private boolean |
isDirectory(String[] args) |
private boolean |
isFile(String[] args) |
private boolean |
length(String[] args) |
private void |
ls(String[] args,
boolean detailed,
boolean recursive) |
private void |
ls(de.schlichtherle.truezip.file.TFile file,
String path,
boolean detailed) |
private void |
ls(de.schlichtherle.truezip.file.TFile file,
String path,
boolean detailed,
boolean recursive)
Lists the given file with the given display path.
|
private static String[] |
lshift(String[] args) |
private static String[] |
lshift(String[] args,
int num) |
static void |
main(String[] args)
Equivalent to
System.exit(new Nzip().run(args));. |
private void |
mkdir(String[] args,
boolean recursive) |
protected de.schlichtherle.truezip.file.TArchiveDetector |
newArchiveDetector()
May be overridden by subclasses to create the
TArchiveDetector which provides file system drivers which
should use the specified charset if supported. |
protected de.schlichtherle.truezip.file.TArchiveDetector |
newArchiveDetector(Charset charset) |
private void |
rm(String[] args,
boolean recursive) |
protected int |
runChecked(String[] args)
Runs this command line utility.
|
private void |
touch(String[] args) |
setup, workprivate final DateFormat dateFormat
private final FieldPosition fpos
private final NumberFormat numberFormat
private static final de.schlichtherle.truezip.socket.IOPoolProvider POOL_PROVIDER
private static final ResourceBundle resources
private void align(StringBuffer buf, long number, int spacing)
private void cat(String[] args) throws Nzip.IllegalUsageException, IOException
private void compact(String[] args) throws Nzip.IllegalUsageException, IOException
private void cpOrMv(String[] args, boolean mv) throws Nzip.IllegalUsageException, IOException
private boolean exists(String[] args) throws Nzip.IllegalUsageException
Nzip.IllegalUsageExceptionprivate boolean isArchive(String[] args) throws Nzip.IllegalUsageException
Nzip.IllegalUsageExceptionprivate boolean isDirectory(String[] args) throws Nzip.IllegalUsageException
Nzip.IllegalUsageExceptionprivate boolean isFile(String[] args) throws Nzip.IllegalUsageException
Nzip.IllegalUsageExceptionprivate boolean length(String[] args) throws Nzip.IllegalUsageException
Nzip.IllegalUsageExceptionprivate void ls(String[] args, boolean detailed, boolean recursive) throws IOException
IOExceptionprivate void ls(de.schlichtherle.truezip.file.TFile file,
String path,
boolean detailed)
private void ls(de.schlichtherle.truezip.file.TFile file,
String path,
boolean detailed,
boolean recursive)
throws IOException
IOExceptionpublic static void main(String[] args) throws de.schlichtherle.truezip.fs.FsSyncException
System.exit(new Nzip().run(args));.de.schlichtherle.truezip.fs.FsSyncExceptionprivate void mkdir(String[] args, boolean recursive) throws Nzip.IllegalUsageException, IOException
protected de.schlichtherle.truezip.file.TArchiveDetector newArchiveDetector()
TArchiveDetector which provides file system drivers which
should use the specified charset if supported.
Note that the archive detector which is returned by the implementation in this class uses some archive drivers which may be pretty slow due to some extra compatibility tests which they perform on every archive.
protected de.schlichtherle.truezip.file.TArchiveDetector newArchiveDetector(Charset charset)
newArchiveDetector()private void rm(String[] args, boolean recursive) throws Nzip.IllegalUsageException, IOException
protected int runChecked(String[] args) throws Nzip.IllegalUsageException, IOException
runChecked in class Applicationargs - A non-empty array of Unix-like commands and optional
parameters.false iff the command is a test which fails,
true otherwise.Nzip.IllegalUsageException - If args does not contain
correct commands or parameters.IOException - On any I/O error.private void touch(String[] args) throws Nzip.IllegalUsageException, IOException
Copyright © 2005-2012 Schlichtherle IT Services. All Rights Reserved.