Package sample.util

Examples of sample.util.SimpleCommandLineParser.containsKey()


    String username = parser.getValue("username");
    String password = parser.getValue("password");
    String domain = parser.getValue("domain");
    String destinationUser = parser.getValue("destination_user");

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


    GlossaryEntry requestEntry = service.getEntry(feedUrl, GlossaryEntry.class);

    System.out.println("You want to update glossary 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/csv";
View Full Code Here

    DocumentEntry requestEntry = service.getEntry(feedUrl, DocumentEntry.class);
    requestEntry.setLastModifiedBy(null);

    System.out.println("You want to update document 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("tmids")) {
      String tmIds = parser.getValue("tmids");
      System.out.println("...by adding translation memories with ids: "
          + tmIds);
      TmsElement tm = new TmsElement();
      for (String tmId : tmIds.split(",")) {
View Full Code Here

        tm.addLink(tmLink);
      }
      requestEntry.setTranslationMemory(tm);
    }

    if (parser.containsKey("glids")) {
      String glIds = parser.getValue("glids");
      System.out.println("...by adding glossaries with ids: "
          + glIds);
      GlossariesElement gl = new GlossariesElement();
      for (String glId : glIds.split(",")) {
View Full Code Here

    String username = parser.getValue("username", "user", "u");
    String password = parser.getValue("password", "pass", "p");
    String token = parser.getValue("token", "token", "t");
    String domain = parser.getValue("domain", "d");
    String siteName = parser.getValue("siteName", "site", "s");
    boolean help = parser.containsKey("help", "h");
    boolean logItUp = parser.containsKey("log", "l");

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

    String password = parser.getValue("password", "pass", "p");
    String token = parser.getValue("token", "token", "t");
    String domain = parser.getValue("domain", "d");
    String siteName = parser.getValue("siteName", "site", "s");
    boolean help = parser.containsKey("help", "h");
    boolean logItUp = parser.containsKey("log", "l");

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

    String title = parser.getValue("title");
    System.out.println("... with title " + title);
    entry.setTitle(new PlainTextConstruct(title));

    if (parser.containsKey("weburl")) {
      String url = parser.getValue("weburl");
      System.out.println("... with html contents from " + url);
      DocumentSource docSource = new DocumentSource(DocumentSource.Type.HTML,
          url);
      entry.setDocumentSource(docSource);
View Full Code Here

      String url = parser.getValue("weburl");
      System.out.println("... with html contents from " + url);
      DocumentSource docSource = new DocumentSource(DocumentSource.Type.HTML,
          url);
      entry.setDocumentSource(docSource);
    } else if (parser.containsKey("wikipediaurl")) {
      String url = parser.getValue("wikipediaurl");
      System.out.println("... with mediawiki contents from " + url);
      DocumentSource docSource = new DocumentSource(DocumentSource.Type.WIKI,
          url);
      entry.setDocumentSource(docSource);
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.