@DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) 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.
This class is not thread safe.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
Nzip.IllegalUsageException |
Application.ProgressMonitor| Modifier and Type | Field and Description |
|---|---|
private static String |
CLASS_NAME |
private DateFormat |
dateFormat |
private FieldPosition |
fpos |
private NumberFormat |
numberFormat |
private static IOPoolProvider |
POOL_PROVIDER |
private static ResourceBundle |
resources |
err, monitor, 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 |
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(TFile file,
String path,
boolean detailed) |
private void |
ls(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 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 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, sync, workrunprivate static final String CLASS_NAME
private static final ResourceBundle resources
private static final IOPoolProvider POOL_PROVIDER
private final NumberFormat numberFormat
private final DateFormat dateFormat
private final FieldPosition fpos
protected 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 TArchiveDetector newArchiveDetector(Charset charset)
newArchiveDetector()public static void main(String[] args) throws FsSyncException
System.exit(new Nzip().run(args));.FsSyncExceptionprotected 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 related exception.private void ls(String[] args, boolean detailed, boolean recursive) throws IOException
IOExceptionprivate void ls(TFile file, String path, boolean detailed, boolean recursive) throws IOException
IOExceptionprivate void align(StringBuffer buf, long number, int spacing)
private void cat(String[] args) throws Nzip.IllegalUsageException, IOException
private void cpOrMv(String[] args, boolean mv) throws Nzip.IllegalUsageException, IOException
private void touch(String[] args) throws Nzip.IllegalUsageException, IOException
private void mkdir(String[] args, boolean recursive) throws Nzip.IllegalUsageException, IOException
private void rm(String[] args, boolean recursive) throws Nzip.IllegalUsageException, IOException
private 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 exists(String[] args) throws Nzip.IllegalUsageException
Nzip.IllegalUsageExceptionprivate boolean length(String[] args) throws Nzip.IllegalUsageException
Nzip.IllegalUsageExceptionCopyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.