Class Truncate

All Implemented Interfaces:
Configurable

@Private @Unstable public class Truncate extends FsCommand
Truncates a file to a new size
  • Field Details

  • Constructor Details

    • Truncate

      public Truncate()
  • Method Details

    • registerCommands

      public static void registerCommands(CommandFactory factory)
    • processOptions

      protected void processOptions(LinkedList<String> args) throws IOException
      Description copied from class: Command
      Must 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:
      processOptions in class Command
      Parameters:
      args - the command line arguments
      Throws:
      IOException - raised on errors performing I/O.
    • processArguments

      protected void processArguments(LinkedList<PathData> args) throws IOException
      Description copied from class: Command
      Processes the command's list of expanded arguments. Command.processArgument(PathData) will be invoked with each item in the list. The loop catches IOExceptions, increments the error count, and displays the exception.
      Overrides:
      processArguments in class Command
      Parameters:
      args - a list of PathData to process
      Throws:
      IOException - if anything goes wrong...
    • processPath

      protected void processPath(PathData item) throws IOException
      Description copied from class: Command
      Hook 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:
      processPath in class Command
      Parameters:
      item - a PathData object
      Throws:
      IOException - if anything else goes wrong in the user-implementation