public class List extends ClientApplication
This application lists the remote files or directories named by its
arguments. For each file, it lists the filename. For each directory, it
lists the contents of the directory. Running the application with no
arguments is equivalent to listing the current directory on the current host
- that is, to giving it the single argument :
.
Unlike the usual ls
command, this application is not capable of
printing file permissions, owner, group, or modification, access, or
creation times - because none of these are stored by the filesystem.
EXIT_FAILURE, EXIT_SUCCESS
Constructor and Description |
---|
List() |
Modifier and Type | Method and Description |
---|---|
void |
coreLogic(java.lang.String[] arguments)
Application main method.
|
private void |
list(java.lang.String remote_path,
boolean show_path)
Lists a remote path.
|
static void |
main(java.lang.String[] arguments)
Application entry point.
|
fatal, report, report, run
public static void main(java.lang.String[] arguments)
public void coreLogic(java.lang.String[] arguments) throws ApplicationFailure
coreLogic
in class ClientApplication
arguments
- Command line arguments.ApplicationFailure
- When an error occurs. If this exception is
thrown, its message string is printed to the
standard error stream, and the application's
exit status is non-zero.private void list(java.lang.String remote_path, boolean show_path) throws ApplicationFailure
This method is called for each command line argument.
remote_path
- Path to be listed.show_path
- Set to true
if the path should be shown
before the contents are listed. This is set when there
is more than one command line argument, and the output
resulting from listing different arguments needs to be
distinguished.ApplicationFailure
- If the path cannot be listed