Package sample.util

Examples of sample.util.SimpleCommandLineParser.containsKey()


      IOException, ServiceException, InterruptedException {

    SimpleCommandLineParser parser = new SimpleCommandLineParser(args);
    String user = parser.getValue("username", "user", "u");
    String password = parser.getValue("password", "pass", "p");
    boolean help = parser.containsKey("help", "h");

    if (help || (user == null || password == null)) {
      printMessage(USAGE_MESSAGE);
      System.exit(1);
    }
View Full Code Here


    // Parse command-line flags
    String project = parser.getValue("project");
    String username = parser.getValue("username");
    String password = parser.getValue("password");

    boolean help = parser.containsKey("help");
    if (help || (project == null)) {
      usage();
      System.exit(help ? 0 : 1);
    }
View Full Code Here

    // Parse command-line flags
    String project = parser.getValue("project");
    String username = parser.getValue("username");
    String password = parser.getValue("password");

    boolean help = parser.containsKey("help");
    if (help || (project == null) || (username == null) || (password == null)) {
      usage();
      System.exit(help ? 0 : 1);
    }
View Full Code Here

   */
  public static void main(String[] args) throws AuthenticationException {
    SimpleCommandLineParser parser = new SimpleCommandLineParser(args);
    String username = parser.getValue("username", "user", "u");
    String password = parser.getValue("password", "pass", "p");
    boolean help = parser.containsKey("help", "h");

    if (help || username == null || password == null) {
      usage();
      System.exit(1);
    }
View Full Code Here

    SimpleCommandLineParser parser = new SimpleCommandLineParser(args);
    String authSub = parser.getValue("authSub", "auth", "a");
    String user = parser.getValue("username", "user", "u");
    String password = parser.getValue("password", "pass", "p");
    String host = parser.getValue("host", "s");
    boolean help = parser.containsKey("help", "h");

    if (host == null) {
      host = DocumentList.DEFAULT_HOST;
    }
View Full Code Here

    if (help || (user == null || password == null) && authSub == null) {
      printMessage(USAGE_MESSAGE);
      System.exit(1);
    }

    if (parser.containsKey("log", "l")) {
      turnOnLogging();
    }

    DocumentListDemo demo = new DocumentListDemo(System.out, APPLICATION_NAME,
        host);
View Full Code Here

    // Set username, password and feed URI from command-line arguments.
    SimpleCommandLineParser parser = new SimpleCommandLineParser(args);
    String userName = parser.getValue("username", "user", "u");
    String userPassword = parser.getValue("password", "pwd", "p");
    boolean help = parser.containsKey("help", "h");
    if (help || (userName == null)) {
      usage();
      System.exit(1);
    }
View Full Code Here

    String serviceName = parser.getValue("serviceName", "service", "s");
    String appName = parser.getValue("appName", "app", "a");
    String feedUrlString = parser.getValue("feedUrl", "feed", "f");
    String username = parser.getValue("username", "user", "u");
    String password = parser.getValue("password", "pass", "p");
    boolean updateEntry = parser.containsKey("update");
    boolean help = parser.containsKey("help", "h");

    if (help) {
      usage();
      System.exit(1);
View Full Code Here

    String appName = parser.getValue("appName", "app", "a");
    String feedUrlString = parser.getValue("feedUrl", "feed", "f");
    String username = parser.getValue("username", "user", "u");
    String password = parser.getValue("password", "pass", "p");
    boolean updateEntry = parser.containsKey("update");
    boolean help = parser.containsKey("help", "h");

    if (help) {
      usage();
      System.exit(1);
    }
View Full Code Here

   */
  public static void main(String[] args) {
    SimpleCommandLineParser parser = new SimpleCommandLineParser(args);
    String username = parser.getValue("username", "user", "u");
    String password = parser.getValue("password", "pass", "p");
    boolean help = parser.containsKey("help", "h");
    boolean authenticated = (username != null) && (password != null);

    if (help) {
      printUsage();
      System.exit(1);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.