コード例 #1
0
ファイル: EmailTool.java プロジェクト: hungdvh3t/morozko-java
 public static void main(String[] args) {
   try {
     ArgList argList = ArgUtils.parseArgs(args);
     Arg help = argList.findArg("help");
     if (help == null) {
       String smtp = argList.findArgValue(ARG_SMTP_HOST);
       String user = argList.findArgValue(ARG_SMTP_USER);
       String pass = argList.findArgValue(ARG_SMTP_PASS);
       String from = argList.findArgValue(ARG_FROM_ADDRESS);
       String to = argList.findArgValue(ARG_TO_LIST);
       String cc = argList.findArgValue(ARG_CC_LIST);
       String bcc = argList.findArgValue(ARG_BCC_LIST);
       String subject = argList.findArgValue(ARG_SUBJECT);
       String body = argList.findArgValue(ARG_BODY);
       String attach = argList.findArgValue(ARG_ATTACH);
       String type = argList.findArgValue(ARG_CONTENT_TYPE);
       EmailFacade.send(smtp, user, pass, from, to, cc, bcc, subject, body, type, attach);
     } else {
       printHelp(System.out);
     }
   } catch (Exception e) {
     printHelp(System.err);
     e.printStackTrace();
   }
 }
コード例 #2
0
ファイル: XJSQL.java プロジェクト: hungdvh3t/morozko-java
  public static void main(String[] arg) {
    try {

      // UIManager.setLookAndFeel( lef );

      ArgList list = ArgUtils.parseArgsProps(arg);

      String url = list.findArg("c").getValue();
      String usr = list.findArg("u").getValue();

      Color bc = parseColor(list.findArg("bc"), null);
      Color fc = parseColor(list.findArg("fc"), null);

      ConnectionFactory cp = ConnArgs.createConnectionFactory(list);

      CMDFrame frame =
          CMDFrame.getInstance(
              "XJSQL " + url + " (" + usr + ")",
              new ConnCMD(SQLCMDUtils.newSQLCMDComplete(cp)),
              new CloseOnExit(),
              bc,
              fc);

      frame.setHelpText(HELP_TEXT);
      frame.setInfoText(INFO_TEXT);

    } catch (Throwable e) {
      System.err.println(" options : ");
      System.err.println("      -d  [jdbc-driver-class] ");
      System.err.println("      -c  [jdbc-url] ");
      System.err.println("      -u  [username] ");
      System.err.println("      -p  [password] ");
      System.err.println(
          "      -bc  [rrrgggbbb] (optional, range is 000-255, default '255255255')");
      System.err.println(
          "      -fc  [rrrgggbbb] (optional, range is 000-255, default '000000000')");
      System.err.println();
      e.printStackTrace();
    }
  }