de.schlichtherle.truezip.sample.file.app
Class UriCat
java.lang.Object
de.schlichtherle.truezip.sample.file.app.CommandLineUtility
de.schlichtherle.truezip.sample.file.app.UriCat
public class UriCat
- extends CommandLineUtility
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));. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UriCat
public UriCat()
main
public static void main(String[] args)
- Equivalent to
System.exit(new CatPath().run(args));.
runChecked
public int runChecked(String[] args)
throws IOException
- Description copied from class:
CommandLineUtility
- Runs this command line utility.
Throws an exception if an error occurs.
- Specified by:
runChecked in class CommandLineUtility
- Parameters:
args - a non-null array of command line parameters.
- Returns:
- the return code for
System.exit(int).
- Throws:
IOException - On any I/O related exception.
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.
IllegalArgumentException - if resource does not
conform to the syntax constraints for URIs.
URISyntaxException
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.