de.schlichtherle.truezip.sample.file.app
Class UriCat
java.lang.Object
de.schlichtherle.truezip.file.TApplication<RuntimeException>
de.schlichtherle.truezip.sample.file.app.Application
de.schlichtherle.truezip.sample.file.app.UriCat
public class UriCat
- extends Application
A poor man's imitate of the cat(1) command line utility
for concatenating the contents of each parameter URI on the standard output.
The URI must be file-based, i.e. the top level file system scheme must
be file.
- Author:
- Christian Schlichtherle
|
Method Summary |
static void |
main(String[] args)
Equivalent to System.exit(new CatPath().run(args));. |
protected int |
runChecked(String[] args)
Runs this command line utility. |
(package private) static void |
uriCat(String resource)
Copies the contents of the parameter resource to the standard output. |
| Methods inherited from class de.schlichtherle.truezip.file.TApplication |
run |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UriCat
public UriCat()
main
public static void main(String[] args)
throws FsSyncException
- Equivalent to
System.exit(new CatPath().run(args));.
- Throws:
FsSyncException
runChecked
protected int runChecked(String[] args)
throws IOException,
URISyntaxException
- Description copied from class:
Application
- Runs this command line utility.
Throws an exception if an error occurs.
Avoid repeating this method and updating the same archive file upon
each call!
This would degrade the overall performance from O(n) to O(m*n),
where m is the number of new or modified entries and n is the number
of all entries in the archive file!
- Specified by:
runChecked in class Application
- Parameters:
args - an array of arguments for this command line utility.
- Returns:
- A negative integer in order to continue calling this method
in a loop.
Otherwise, the return value is used as the
exit status of the VM.
- Throws:
IOException
URISyntaxException
uriCat
static void uriCat(String resource)
throws IOException,
URISyntaxException
- Copies the contents of the parameter resource to the standard output.
- Parameters:
resource - the URI string of the resource to copy.
The URI must be file-based, i.e. the top level file system
scheme must be file.
- Throws:
IOException - if accessing the resource results in an I/O error.
URISyntaxException - if resource does not
conform to the syntax constraints for URIs.
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.