@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat( 1, Integer.MAX_VALUE, "f", "r", "R", "skipTrash", "safely"); cf.parse(args); ignoreFNF = cf.getOpt("f"); deleteDirs = cf.getOpt("r") || cf.getOpt("R"); skipTrash = cf.getOpt("skipTrash"); safeDelete = cf.getOpt("safely"); }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(1, Integer.MAX_VALUE, "f", "p", "l", "d"); cf.addOptionWithValue("t"); cf.parse(args); setNumberThreads(cf.getOptValue("t")); 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(0, Integer.MAX_VALUE, "h", "s", "v", "x"); cf.parse(args); setHumanReadable(cf.getOpt("h")); summary = cf.getOpt("s"); showHeaderLine = cf.getOpt("v"); excludeSnapshots = cf.getOpt("x"); if (args.isEmpty()) args.add(Path.CUR_DIR); }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(0, Integer.MAX_VALUE, OPTION_PATHONLY, OPTION_DIRECTORY, OPTION_HUMAN, OPTION_HIDENONPRINTABLE, OPTION_RECURSIVE, OPTION_REVERSE, OPTION_MTIME, OPTION_SIZE, OPTION_ATIME, OPTION_ECPOLICY); cf.parse(args); pathOnly = cf.getOpt(OPTION_PATHONLY); dirRecurse = !cf.getOpt(OPTION_DIRECTORY); setRecursive(cf.getOpt(OPTION_RECURSIVE) && dirRecurse); humanReadable = cf.getOpt(OPTION_HUMAN); hideNonPrintable = cf.getOpt(OPTION_HIDENONPRINTABLE); orderReverse = cf.getOpt(OPTION_REVERSE); orderTime = cf.getOpt(OPTION_MTIME); orderSize = !orderTime && cf.getOpt(OPTION_SIZE); useAtime = cf.getOpt(OPTION_ATIME); displayECPolicy = cf.getOpt(OPTION_ECPOLICY); if (args.isEmpty()) args.add(Path.CUR_DIR); initialiseOrderComparator(); }
@Override protected void processOptions(LinkedList<String> args) { this.timestamp = StringUtils.popOptionWithArgument("-" + OPTION_USE_TIMESTAMP, args); CommandFormat cf = new CommandFormat(1, Integer.MAX_VALUE, OPTION_USE_TIMESTAMP, OPTION_CHANGE_ONLY_ACCESS_TIME, OPTION_CHANGE_ONLY_MODIFICATION_TIME); cf.parse(args); this.changeModTime = cf.getOpt(OPTION_CHANGE_ONLY_MODIFICATION_TIME); this.changeAccessTime = cf.getOpt(OPTION_CHANGE_ONLY_ACCESS_TIME); this.doNotCreate = cf.getOpt(OPTION_DO_NOT_CREATE_FILE); }
@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(0, Integer.MAX_VALUE, "h"); cf.parse(args); setHumanReadable(cf.getOpt("h")); if (args.isEmpty()) args.add(Path.SEPARATOR); }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat( 1, Integer.MAX_VALUE, "-ignore-fail-on-non-empty"); cf.parse(args); ignoreNonEmpty = cf.getOpt("-ignore-fail-on-non-empty"); }
@Override protected void processOptions(LinkedList<String> args) { CommandFormat cf = new CommandFormat(1, Integer.MAX_VALUE, "p"); cf.parse(args); createParents = cf.getOpt("p"); }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(1, Integer.MAX_VALUE, "ignoreCrc"); cf.parse(args); verifyChecksum = !cf.getOpt("ignoreCrc"); }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(2, Integer.MAX_VALUE, "w"); cf.parse(args); waitOpt = cf.getOpt("w"); try { newLength = Long.parseLong(args.removeFirst()); } catch(NumberFormatException nfe) { displayWarning("Illegal length, a non-negative integer expected"); throw nfe; } if(newLength < 0) { throw new IllegalArgumentException("length must be >= 0"); } }
@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, "R"); cf.parse(args); setRecursive(cf.getOpt("R")); if (args.getFirst().contains("%")) format = args.removeFirst(); cf.parse(args); // make sure there's still at least one arg }
@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 { try { CommandFormat cf = new CommandFormat(2, Integer.MAX_VALUE, "nl", "skip-empty-file"); cf.parse(args); delimiter = cf.getOpt("nl") ? "\n" : null; skipEmptyFileDelimiter = cf.getOpt("skip-empty-file"); dst = new PathData(new URI(args.removeLast()), getConf()); if (dst.exists && dst.stat.isDirectory()) { throw new PathIsDirectoryException(dst.toString()); } srcs = new LinkedList<PathData>(); } catch (URISyntaxException e) { throw new IOException("unexpected URISyntaxException", e); } }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(2, Integer.MAX_VALUE, "R", "w"); cf.parse(args); waitOpt = cf.getOpt("w"); setRecursive(true); try { newRep = Short.parseShort(args.removeFirst()); } catch (NumberFormatException nfe) { displayWarning("Illegal replication, a positive integer expected"); throw nfe; } if (newRep < 1) { throw new IllegalArgumentException("replication must be >= 1"); } }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(2, Integer.MAX_VALUE, "R", null); cf.parse(args); setRecursive(cf.getOpt("R")); String modeStr = args.removeFirst(); try { pp = new ChmodParser(modeStr); } catch (IllegalArgumentException iea) { // TODO: remove "chmod : " so it's not doubled up in output, but it's // here for backwards compatibility... throw new IllegalArgumentException( "chmod : mode '" + modeStr + "' does not match the expected pattern."); } }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(0, Integer.MAX_VALUE, "R"); cf.parse(args); setRecursive(cf.getOpt("R")); if (args.isEmpty()) { throw new HadoopIllegalArgumentException("<path> is missing"); } if (args.size() > 1) { throw new HadoopIllegalArgumentException("Too many arguments"); } }
@Override protected void processOptions(LinkedList<String> args) throws IOException { CommandFormat cf = new CommandFormat(2, Integer.MAX_VALUE, "R"); cf.parse(args); setRecursive(cf.getOpt("R")); parseOwnerGroup(args.removeFirst()); }
@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); }