コード例 #1
0
  public static void main(String args[]) {
    if (args.length < 1) {
      System.err.println(
          "Usage: java org.globusonline.transfer.ErrorTest "
              + "username [cafile certfile keyfile [baseurl]]]");
      System.exit(1);
    }
    String username = args[0];

    String cafile = null;
    if (args.length > 1 && args[1].length() > 0) cafile = args[1];

    String certfile = null;
    if (args.length > 2 && args[2].length() > 0) certfile = args[2];

    String keyfile = null;
    if (args.length > 3 && args[3].length() > 0) keyfile = args[3];

    String baseUrl = null;
    if (args.length > 4 && args[4].length() > 0) baseUrl = args[4];

    try {
      JSONTransferAPIClient c =
          new JSONTransferAPIClient(username, cafile, certfile, keyfile, baseUrl);
      System.out.println("base url: " + c.getBaseUrl());
      ErrorTest et = new ErrorTest(c);
      et.run();

      // test auth error
      System.out.println("=== 400 Auth Failed ===");
      c = new JSONTransferAPIClient(username, cafile, null, null, baseUrl);
      try {
        c.getResult("/tasksummary");
      } catch (APIError e) {
        e.printStackTrace();
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
コード例 #2
0
 private void exit_btActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_exit_btActionPerformed
   // TODO add your handling code here:
   System.exit(0);
 } // GEN-LAST:event_exit_btActionPerformed