protected int getFormatFlags(VaultFsConsoleExecutionContext ctx, CommandLine cl) { int fmtFlag = 0; fmtFlag |= cl.hasOption(optTime) ? F_FLAG_TIME : 0; fmtFlag |= cl.hasOption(optSize) ? F_FLAG_SIZE : 0; fmtFlag |= cl.hasOption(optMime) ? F_FLAG_MIME : 0; fmtFlag |= cl.hasOption(optLong) ? F_FLAG_LONG : 0; return fmtFlag; }
protected int getFormatFlags(VaultFsConsoleExecutionContext ctx, CommandLine cl) { int fmtFlag = 0; fmtFlag |= cl.hasOption(optType) ? F_FLAG_TYPE : 0; return fmtFlag; }
public boolean hasOption(Option opt) { if (cmdLine == null) throw new IllegalStateException(); return this.cmdLine.hasOption(opt); }
public boolean hasOption(String optName) { if (cmdLine == null) throw new IllegalStateException(); return this.cmdLine.hasOption(optName); }
@SuppressWarnings("unchecked") protected void doExecute(VaultFsApp app, CommandLine cl) throws Exception { List<String> localPaths = cl.getValues(argLocalPath); List<File> localFiles = app.getPlatformFiles(localPaths, false); File localDir = app.getPlatformFile("", true); VltContext vCtx = app.createVaultContext(localDir); vCtx.setVerbose(cl.hasOption(OPT_VERBOSE)); vCtx.setQuiet(cl.hasOption(optOnlyControlled)); Action a = cl.hasOption(optShowUpdate) ? new RemoteStatus(localDir, localFiles, cl.hasOption(optNonRecursive)) : new Status(localDir, localFiles, cl.hasOption(optNonRecursive)); vCtx.execute(a); }
public boolean execute(ExecutionContext ctx, CommandLine cl) throws Exception { if (cl.hasOption(getCommand())) { doExecute(ctx, cl); return true; } else { return false; } }
@SuppressWarnings("unchecked") protected void doExecute(VaultFsApp app, CommandLine cl) throws Exception { List<String> localPaths = cl.getValues(argLocalPath); List<File> localFiles = app.getPlatformFiles(localPaths, false); File localDir = app.getPlatformFile("", true); VltContext vCtx = app.createVaultContext(localDir); vCtx.setVerbose(cl.hasOption(OPT_VERBOSE)); vCtx.setQuiet(cl.hasOption(OPT_QUIET)); Add a = new Add(localDir, localFiles, cl.hasOption(optNonRecursive), cl.hasOption(optForce)); vCtx.execute(a); }
public boolean execute(ConsoleExecutionContext ctx, CommandLine cl) throws Exception { if (cl.hasOption(getCommand())) { doExecute(ctx, cl); return true; } else { return false; } }
@SuppressWarnings("unchecked") protected void doExecute(VaultFsApp app, CommandLine cl) throws Exception { List<String> localPaths = cl.getValues(argLocalPath); List<File> localFiles = app.getPlatformFiles(localPaths, false); File localDir = app.getPlatformFile("", true); VltContext vCtx = app.createVaultContext(localDir); vCtx.setVerbose(cl.hasOption(OPT_VERBOSE)); vCtx.setQuiet(cl.hasOption(OPT_QUIET)); Update u = new Update(localDir, localFiles, cl.hasOption(optNonRecursive)); u.setForce(cl.hasOption(optForce)); vCtx.execute(u); }
@SuppressWarnings("unchecked") protected void doExecute(VaultFsApp app, CommandLine cl) throws Exception { List<String> localPaths = cl.getValues(argLocalPath); List<File> localFiles = app.getPlatformFiles(localPaths, false); File localDir = app.getPlatformFile("", true); VltContext vCtx = app.createVaultContext(localDir); vCtx.setVerbose(cl.hasOption(OPT_VERBOSE)); vCtx.setQuiet(cl.hasOption(OPT_QUIET)); Delete d = new Delete(localDir, localFiles, false, cl.hasOption(optForce)); vCtx.execute(d); }
@SuppressWarnings("unchecked") protected void doExecute(VaultFsApp app, CommandLine cl) throws Exception { List<String> localPaths = cl.getValues(argLocalPath); List<File> localFiles = app.getPlatformFiles(localPaths, false); File localDir = app.getPlatformFile("", true); VltContext vCtx = app.createVaultContext(localDir); vCtx.setVerbose(cl.hasOption(OPT_VERBOSE)); vCtx.setQuiet(cl.hasOption(OPT_QUIET)); Info u = new Info(localDir, localFiles, !cl.hasOption(optRecursive)); vCtx.execute(u); }
protected void doExecute(VaultFsConsoleExecutionContext ctx, CommandLine cl) throws Exception { String path = (String) cl.getValue(argPath); int depth = Integer.MAX_VALUE; if (cl.hasOption(optRecursive)) { depth = ((Long) cl.getValue(optRecursive)).intValue(); } ConsoleFile file = ctx.getFile(path, true); tree(file, depth, ""); }
@SuppressWarnings("unchecked") protected void doExecute(VaultFsApp app, CommandLine cl) throws Exception { List<String> localPaths = cl.getValues(argLocalPath); List<File> localFiles = app.getPlatformFiles(localPaths, false); File localDir = app.getPlatformFile("", true); VltContext vCtx = app.createVaultContext(localDir); vCtx.setQuiet(cl.hasOption(OPT_QUIET)); PropList a = new PropList(localDir, localFiles, !cl.hasOption(optRecursive)); vCtx.execute(a); }
@SuppressWarnings("unchecked") protected void doExecute(VaultFsApp app, CommandLine cl) throws Exception { List<String> localPaths = cl.getValues(argLocalPath); List<File> localFiles = app.getPlatformFiles(localPaths, false); File localDir = app.getPlatformFile("", true); VltContext vCtx = app.createVaultContext(localDir); vCtx.setVerbose(cl.hasOption(OPT_VERBOSE)); Diff a = new Diff(localDir, localFiles, cl.hasOption(optNonRecursive)); vCtx.execute(a); }
@SuppressWarnings("unchecked") protected void doExecute(VaultFsApp app, CommandLine cl) throws Exception { List<String> localPaths = cl.getValues(argLocalPath); List<File> localFiles = app.getPlatformFiles(localPaths, false); File localDir = app.getPlatformFile("", true); VltContext vCtx = app.createVaultContext(localDir); vCtx.setQuiet(cl.hasOption(OPT_QUIET)); Revert r = new Revert(localDir, localFiles, cl.hasOption(optRecursive)); vCtx.execute(r); }
@SuppressWarnings("unchecked") protected void doExecute(VaultFsApp app, CommandLine cl) throws Exception { List<String> localPaths = cl.getValues(argLocalPath); List<File> localFiles = app.getPlatformFiles(localPaths, false); File localDir = app.getPlatformFile("", true); VltContext vCtx = app.createVaultContext(localDir); vCtx.setQuiet(cl.hasOption(OPT_QUIET)); PropGet a = new PropGet(localDir, localFiles, !cl.hasOption(optRecursive), (String) cl.getValue(argPropName)); vCtx.execute(a); }
protected void doExecute(VaultFsConsoleExecutionContext ctx, CommandLine cl) throws Exception { String path = (String) cl.getValue(argPath); boolean recursive = cl.hasOption(optRecursive); ConsoleFile file = ctx.getFile(path, true); if (file instanceof AggregateCFile) { AggregateImpl node = (AggregateImpl) file.unwrap(); node.remove(recursive); } else { throw new ExecutionException("remove only allowed in afct mode."); } }
protected void doExecute(VaultFsConsoleExecutionContext ctx, CommandLine cl) throws Exception { if (ctx.getVaultFsApp().isLoggedIn() && cl.hasOption(optForce)) { ctx.getVaultFsApp().logout(); } ctx.getVaultFsApp().login( (String) cl.getValue(optCreds), (String) cl.getValue(argWorkspace)); }
protected void doExecute(VaultFsConsoleExecutionContext ctx, CommandLine cl) throws Exception { String uri = (String) cl.getValue(argURI); if (uri != null) { ctx.getVaultFsApp().setProperty(VaultFsApp.KEY_DEFAULT_URI, uri); } if (ctx.getVaultFsApp().isConnected() && cl.hasOption(optForce)) { ctx.getVaultFsApp().disconnect(); } ctx.getVaultFsApp().connect(); }