Package net.sourceforge.argparse4j.inf

Examples of net.sourceforge.argparse4j.inf.ArgumentParserException


    }
  }   
 
  private void verifyIsDirectory(ArgumentParser parser, Path file) throws ArgumentParserException, IOException {
    if (!fs.isDirectory(file)) {
      throw new ArgumentParserException("Not a directory: " + file, parser);
    }
  }   
View Full Code Here


  }   
 
  private void verifyCanRead(ArgumentParser parser, Path file) throws ArgumentParserException, IOException {
    verifyExists(parser, file);
    if (!fs.getFileStatus(file).getPermission().getUserAction().implies(FsAction.READ)) {
      throw new ArgumentParserException("Insufficient permissions to read file: " + file, parser);
    }
  }   
View Full Code Here

  }   
 
  private void verifyCanWrite(ArgumentParser parser, Path file) throws ArgumentParserException, IOException {
    verifyExists(parser, file);
    if (!fs.getFileStatus(file).getPermission().getUserAction().implies(FsAction.WRITE)) {
      throw new ArgumentParserException("Insufficient permissions to write file: " + file, parser);
    }
  }   
View Full Code Here

  }   
 
  private void verifyCanWriteParent(ArgumentParser parser, Path file) throws ArgumentParserException, IOException {
    Path parent = file.getParent();
    if (parent == null || !fs.exists(parent) || !fs.getFileStatus(parent).getPermission().getUserAction().implies(FsAction.WRITE)) {
      throw new ArgumentParserException("Cannot write parent of file: " + file, parser);
    }
  }   
View Full Code Here

  }   
 
  private void verifyCanExecute(ArgumentParser parser, Path file) throws ArgumentParserException, IOException {
    verifyExists(parser, file);
    if (!fs.getFileStatus(file).getPermission().getUserAction().implies(FsAction.EXECUTE)) {
      throw new ArgumentParserException("Insufficient permissions to execute file: " + file, parser);
    }
  }   
View Full Code Here

    }
  }   
 
  private void verifyIsAbsolute(ArgumentParser parser, Path file) throws ArgumentParserException {
    if (!file.isAbsolute()) {
      throw new ArgumentParserException("Not an absolute file: " + file, parser);
    }
  }   
View Full Code Here

    }
  }   
 
  private void verifyHasScheme(ArgumentParser parser, Path file) throws ArgumentParserException {
    if (file.toUri().getScheme() == null) {
      throw new ArgumentParserException("URI scheme is missing in path: " + file, parser);
    }
  }
View Full Code Here

    }
  }

  private void verifyScheme(ArgumentParser parser, Path file) throws ArgumentParserException {
    if (!verifyScheme.equals(file.toUri().getScheme())) {
      throw new ArgumentParserException("Scheme of path: " + file + " must be: " + verifyScheme, parser);
    }
  }
View Full Code Here

    setupCommands();

    if (args.length == 0) {
      parser.printHelp();
      throw new ArgumentParserException(parser);
    }

    try {
      this.options = parser.parseArgs(args);
    } catch (ArgumentParserException e) {
View Full Code Here

    } else if (!cliConfig.getDomainsString().isEmpty()) {
      final Iterable<String> domains = parseDomainsString(cliConfig.getDomainsString());
      return Target.from(srvName, domains);
    }

    handleError(parser, new ArgumentParserException(
        "no masters specified.  Use the -z or -d option to specify which helios "
        + "cluster/master to connect to", parser));
    return ImmutableList.of();
  }
View Full Code Here

TOP

Related Classes of net.sourceforge.argparse4j.inf.ArgumentParserException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.