@Override protected void processArguments(LinkedList<PathData> args) throws IOException { setUsagesTable(new TableBuilder( "Filesystem", "Size", "Used", "Available", "Use%", "Mounted on")); getUsagesTable().setRightAlign(1, 2, 3, 4); super.processArguments(args); if (!getUsagesTable().isEmpty()) { getUsagesTable().printToStream(out); } }
@Override protected void processArguments(LinkedList<PathData> args) throws IOException { super.processArguments(args); if (waitOpt) waitForRecovery(); }
@Override protected void processOptions(LinkedList<String> args) throws IOException { popPreserveOption(args); CommandFormat cf = new CommandFormat(2, Integer.MAX_VALUE, "f", "d"); cf.parse(args); setDirectWrite(cf.getOpt("d")); setOverwrite(cf.getOpt("f")); // should have a -r option setRecursive(true); getRemoteDestination(args); }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(1, Integer.MAX_VALUE, "f", "p", "l", "d"); cf.parse(args); setOverwrite(cf.getOpt("f")); setPreserve(cf.getOpt("p")); setLazyPersist(cf.getOpt("l")); setDirectWrite(cf.getOpt("d")); getRemoteDestination(args); // should have a -r option setRecursive(true); }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat( 1, Integer.MAX_VALUE, "crc", "ignoreCrc", "p", "f"); cf.parse(args); setWriteChecksum(cf.getOpt("crc")); setVerifyChecksum(!cf.getOpt("ignoreCrc")); setPreserve(cf.getOpt("p")); setOverwrite(cf.getOpt("f")); setRecursive(true); getLocalDestination(args); } }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(1, 1, "f"); cf.parse(args); follow = cf.getOpt("f"); }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(2, Integer.MAX_VALUE); cf.parse(args); getRemoteDestination(args); }
@Override protected void processArguments(LinkedList<PathData> args) throws IOException { if (showHeaderLine) { setUsagesTable(new TableBuilder("SIZE", "DISK_SPACE_CONSUMED_WITH_ALL_REPLICAS", "FULL_PATH_NAME")); } else { setUsagesTable(new TableBuilder(3)); } super.processArguments(args); if (!getUsagesTable().isEmpty()) { getUsagesTable().printToStream(out); } }
/** * Creates a new object for a child entry in this directory * @param child the basename will be appended to this object's path * @return PathData for the child * @throws IOException if this object does not exist or is not a directory */ public PathData getPathDataForChild(PathData child) throws IOException { checkIfExists(FileTypeRequirement.SHOULD_BE_DIRECTORY); return new PathData(fs, getStringForChildPath(child.path)); }
@Override protected void processArguments(LinkedList<PathData> args) throws IOException { super.processArguments(args); if (waitOpt) waitForReplication(); }
private void copyFile(PathData src, PathData target) throws IOException { if (isPathRecursable(src)) { throw new PathIsDirectoryException(src.toString()); } super.copyFileToTarget(src, target); }
@Override public String getMessage() { return "Not enough arguments: " + super.getMessage(); } }
/** * Looks up the file status for a path. If the path * doesn't exist, then the status will be null * @param fs the FileSystem for the path * @param pathString a string for a path * @throws IOException if anything goes wrong */ private PathData(FileSystem fs, String pathString) throws IOException { this(fs, pathString, lookupStat(fs, pathString, true)); }
@Override protected void processNonexistentPath(PathData item) throws IOException { exitCode = 1; // flag that a path is bad super.processNonexistentPath(item); }
/** * Is the command deprecated? * @return boolean */ public final boolean isDeprecated() { return (getReplacementCommand() != null); }
public int compare(PathData o1, PathData o2) { return o1.compareTo(o2) * (isOrderReverse() ? -1 : 1); } };