Tabnine Logo
CommandLine.getValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getValue
method
in
org.apache.commons.cli2.CommandLine

Best Java code snippets using org.apache.commons.cli2.CommandLine.getValue (Showing top 20 results out of 315)

origin: org.apache.mahout/mahout-mrlegacy

static String getString(CommandLine commandLine, Option option) {
 Object val = commandLine.getValue(option);
 if (val != null) {
  return val.toString();
 }
 return null;
}
origin: org.apache.jackrabbit.vault/vault-cli

@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);
}
origin: org.geotools/gt-coveragetools

public Object getOptionValue(String optName) {
  if (cmdLine == null)
    throw new IllegalStateException();
  return this.cmdLine.getValue(optName);
}
origin: org.geotools/gt-coveragetools

public Object getOptionValue(Option opt) {
  if (cmdLine == null)
    throw new IllegalStateException();
  return this.cmdLine.getValue(opt);
}
origin: org.apache.mahout/mahout-mrlegacy

static Double getDouble(CommandLine commandLine, Option option) {
 Object val = commandLine.getValue(option);
 if (val != null) {
  return Double.parseDouble(val.toString());
 }
 return null;
}
origin: org.apache.jackrabbit.vault/vault-cli

protected void doExecute(ExecutionContext ctx, CommandLine cl)
    throws Exception {
  String name = (String) cl.getValue(argName);
  if (name == null) {
    System.out.println("Hello, world.");
  } else {
    System.out.println("Hello, " + name + ".");
  }
}
origin: org.jvnet.hudson.hadoop/hadoop-core

private static <InterfaceType> 
Class<? extends InterfaceType> getClass(CommandLine cl, String key, 
                    JobConf conf, 
                    Class<InterfaceType> cls
                    ) throws ClassNotFoundException {
 return conf.getClassByName((String) cl.getValue(key)).asSubclass(cls);
}
origin: org.apache.jackrabbit.vault/vault-cli

protected void doExecute(ConsoleExecutionContext ctx, CommandLine cl) throws Exception {
  String path = (String) cl.getValue(argPath, "/");
  ctx.cd(path);
}
origin: org.apache.jackrabbit.vault/vault-cli

protected void doExecute(ExecutionContext ctx, CommandLine cl) throws Exception {
  String cmd = (String) cl.getValue(argCommand);
  ctx.printHelp(cmd);
}
origin: org.apache.jackrabbit.vault/vault-cli

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, "");
}
origin: org.apache.jackrabbit.vault/vault-cli

protected void doExecute(ConsoleExecutionContext ctx, CommandLine cl) throws Exception {
  String file = (String) cl.getValue(argFile);
  ctx.getApplication().saveConfig(file);
}
origin: org.apache.jackrabbit.vault/vault-cli

protected void doExecute(ConsoleExecutionContext ctx, CommandLine cl) throws Exception {
  String file = (String) cl.getValue(argFile);
  ctx.getApplication().loadConfig(file);
}
origin: org.apache.jackrabbit.vault/vault-cli

protected void doExecute(ConsoleExecutionContext ctx, CommandLine cl) throws Exception {
  String arg = (String) cl.getValue(argContext);
  ctx.getConsole().switchContext(arg);
}
origin: org.apache.jackrabbit.vault/vault-cli

protected void doExecute(ConsoleExecutionContext ctx, CommandLine cl) throws Exception {
  String macro = (String) cl.getValue(argMacro);
  String cmd = ctx.getProperty("macro." + macro);
  if (cmd == null) {
    throw new ExecutionException("Macro " + macro + " does not exist.");
  }
  ctx.execute(cmd);
}
origin: org.apache.jackrabbit.vault/vault-cli

protected void doExecute(VaultFsConsoleExecutionContext ctx, CommandLine cl) throws Exception {
  int fmtFlag = getFormatFlags(ctx, cl);
  String path = (String) cl.getValue(argPath);
  ConsoleFile file = ctx.getFile(path, true);
  ls(file, fmtFlag, 0);
}
origin: org.apache.jackrabbit.vault/vault-cli

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));
}
origin: org.apache.jackrabbit.vault/vault-cli

protected void doExecute(VaultFsConsoleExecutionContext ctx, CommandLine cl) throws Exception {
  String jcrPath = (String) cl.getValue(argJcrPath);
  ConsoleFile wo = ctx.getFile(jcrPath, true);
  if (wo instanceof VaultFsCFile) {
    VaultFile file = (VaultFile) wo.unwrap();
    file.invalidate();
  } else {
    throw new ExecutionException("'cat' only possible in jcr fs context");
  }
}
origin: org.apache.jackrabbit.vault/vault-cli

protected void doExecute(ExecutionContext ctx, CommandLine cl) throws Exception {
  String file = (String) cl.getValue(argFile);
  ctx.getApplication().loadConfig(file);
  ctx.getApplication().getConsole().run();
}
origin: org.apache.jackrabbit.vault/vault-cli

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.");
  }
}
origin: org.apache.jackrabbit.vault/vault-cli

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();
}
org.apache.commons.cli2CommandLinegetValue

Popular methods of CommandLine

  • hasOption
  • getValues
  • getOptions

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • getResourceAsStream (ClassLoader)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Table (org.hibernate.mapping)
    A relational table
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now