Package sample.util

Examples of sample.util.SimpleCommandLineParser.containsKey()


      Query.CategoryFilter filter = new Query.CategoryFilter();
      filter.addCategory(new HiddenCategory());
      query.addCategoryFilter(filter);
    }

    if (parser.containsKey("excludehidden")) {
      System.out.println("...that are not hidden");
      Query.CategoryFilter filter = new Query.CategoryFilter();
      filter.addExcludeCategory(new HiddenCategory());
      query.addCategoryFilter(filter);
    }
View Full Code Here


        TranslationMemoryEntry.class);

    System.out.println("You want to update translation memory with id:"
        + id + " ...");

    if (parser.containsKey("title")) {
      String title = parser.getValue("title");
      System.out.println("...by changing title to " + title);
      requestEntry.setTitle(new PlainTextConstruct(title));
    }
View Full Code Here

      String title = parser.getValue("title");
      System.out.println("...by changing title to " + title);
      requestEntry.setTitle(new PlainTextConstruct(title));
    }

    if (parser.containsKey("file")) {
      String filename = parser.getValue("file");
      System.out.println("...by appending contents from file " + filename);
      File file = new File(filename);
      String mimeType = "text/xml";
View Full Code Here

  public static void main(String[] args)
      throws IOException, ServiceException {
    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

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

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

    HealthDemo demo = new HealthDemo(
        new HealthService("Sample Health Client"), System.out);
View Full Code Here

  public static void main(String[] args) {
    // Get username and password from command-line arguments.
    SimpleCommandLineParser parser = new SimpleCommandLineParser(args);
    String userName = parser.getValue("username", "user", "u");
    String userPassword = parser.getValue("password", "pass", "p");
    boolean help = parser.containsKey("help", "h");
    if (help || (userName == null) || (userPassword == null)) {
      usage();
      System.exit(1);
    }
View Full Code Here

    String password = parser.getValue("password");
    String domain = parser.getValue("domain");
    String destinationUser = parser.getValue("destination_user");
    String delegationEmailId = parser.getValue("delegationEmailId");
    String setting = parser.getValue("setting");
    boolean doGet = parser.containsKey("get");
    boolean doDelete = parser.containsKey("delete");
    boolean doAddOrUpdate = false;

    boolean help = parser.containsKey("help");
    boolean enable = !parser.containsKey("disable");
View Full Code Here

    String domain = parser.getValue("domain");
    String destinationUser = parser.getValue("destination_user");
    String delegationEmailId = parser.getValue("delegationEmailId");
    String setting = parser.getValue("setting");
    boolean doGet = parser.containsKey("get");
    boolean doDelete = parser.containsKey("delete");
    boolean doAddOrUpdate = false;

    boolean help = parser.containsKey("help");
    boolean enable = !parser.containsKey("disable");
    if (doGet && doDelete) {
View Full Code Here

    String setting = parser.getValue("setting");
    boolean doGet = parser.containsKey("get");
    boolean doDelete = parser.containsKey("delete");
    boolean doAddOrUpdate = false;

    boolean help = parser.containsKey("help");
    boolean enable = !parser.containsKey("disable");
    if (doGet && doDelete) {
      System.out.println(
          "Choose method as one of --get or --delete, or leave blank for create/update.\n");
      printUsageAndExit();
View Full Code Here

    boolean doGet = parser.containsKey("get");
    boolean doDelete = parser.containsKey("delete");
    boolean doAddOrUpdate = false;

    boolean help = parser.containsKey("help");
    boolean enable = !parser.containsKey("disable");
    if (doGet && doDelete) {
      System.out.println(
          "Choose method as one of --get or --delete, or leave blank for create/update.\n");
      printUsageAndExit();
    } else if (!doGet && !doDelete) {
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.