Package org.apache.hadoop.fs.shell
Class TouchCommands.Touch
java.lang.Object
org.apache.hadoop.conf.Configured
org.apache.hadoop.fs.shell.Command
org.apache.hadoop.fs.shell.FsCommand
org.apache.hadoop.fs.shell.TouchCommands
org.apache.hadoop.fs.shell.TouchCommands.Touch
- All Implemented Interfaces:
Configurable
- Enclosing class:
- TouchCommands
A UNIX like touch command.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.fs.shell.TouchCommands
TouchCommands.Touch, TouchCommands.Touchz -
Field Summary
FieldsFields inherited from class org.apache.hadoop.fs.shell.Command
args, COMMAND_DESCRIPTION_FIELD, COMMAND_NAME_FIELD, COMMAND_USAGE_FIELD, err, exceptions, exitCode, name, numErrors, out, recursive -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidProvides a hook for handling paths that don't exist.protected voidprocessOptions(LinkedList<String> args) Must be implemented by commands to process the command line flags and check the bounds of the remaining arguments.protected voidprocessPath(PathData item) Hook for commands to implement an operation to be applied on each path for the command.Methods inherited from class org.apache.hadoop.fs.shell.TouchCommands
registerCommandsMethods inherited from class org.apache.hadoop.fs.shell.FsCommand
getCommandName, processRawArguments, run, runAllMethods inherited from class org.apache.hadoop.fs.shell.Command
displayError, displayError, displayWarning, exitCodeForError, expandArgument, expandArguments, getCommandFactory, getDepth, getDescription, getListingGroupSize, getName, getReplacementCommand, getUsage, isDeprecated, isPathRecursable, isRecursive, isSorted, postProcessPath, processArgument, processArguments, processPathArgument, processPaths, processPaths, recursePath, run, run, setCommandFactory, setName, setRecursiveMethods inherited from class org.apache.hadoop.conf.Configured
getConf, setConf
-
Field Details
-
NAME
- See Also:
-
USAGE
- See Also:
-
DESCRIPTION
- See Also:
-
-
Constructor Details
-
Touch
public Touch()
-
-
Method Details
-
getDateFormat
-
processOptions
Description copied from class:CommandMust be implemented by commands to process the command line flags and check the bounds of the remaining arguments. If an IllegalArgumentException is thrown, the FsShell object will print the short usage of the command.- Overrides:
processOptionsin classCommand- Parameters:
args- the command line arguments
-
processPath
Description copied from class:CommandHook for commands to implement an operation to be applied on each path for the command. Note implementation of this method is optional if earlier methods in the chain handle the operation.- Overrides:
processPathin classCommand- Parameters:
item- aPathDataobject- Throws:
IOException- if anything else goes wrong in the user-implementation
-
processNonexistentPath
Description copied from class:CommandProvides a hook for handling paths that don't exist. By default it will throw an exception. Primarily overriden by commands that create paths such as mkdir or touch.- Overrides:
processNonexistentPathin classCommand- Parameters:
item- thePathDatathat doesn't exist- Throws:
FileNotFoundException- if arg is a path and it doesn't existIOException- if anything else goes wrong...
-