private XmlUIElement getXmlUIElementFor(String typeArg) {
   if (typeToClassMappingProp == null) {
     setUpMappingsHM();
   }
   String clsName = (String) typeToClassMappingProp.get(typeArg);
   if ((clsName != null) && !(clsName.equals("*NOTFOUND*")) && !(clsName.equals("*EXCEPTION*"))) {
     try {
       Class cls = Class.forName(clsName);
       return (XmlUIElement) cls.newInstance();
     } catch (Throwable th) {
       typeToClassMappingProp.put(typeArg, "*EXCEPTION*");
       showErrorMessage(
           MessageFormat.format(
               ProvClientUtils.getString(
                   "{0} occurred when trying to get the XmlUIElement for type : {1}"),
               new Object[] {th.getClass().getName(), typeArg}));
       th.printStackTrace();
       return null;
     }
   } else if (clsName == null) {
     typeToClassMappingProp.put(typeArg, "*NOTFOUND*");
     showErrorMessage(
         MessageFormat.format(
             ProvClientUtils.getString(
                 "The type {0} does not have the corresponding XMLUIElement specified in the TypeToUIElementMapping.txt file"),
             new Object[] {typeArg}));
   }
   return null;
 }
Example #2
0
  public static void main(String args[]) {

    // The stat reporter writes out the test info and results
    // into the top-level quicklook directory during a run.

    stat.addDescription("http-listener reader-threads unit tests.");

    String host = args[0];
    String portS = args[1];
    String contextRoot = args[2];

    int port = new Integer(portS).intValue();
    String name;

    try {
      goGet(host, port, "FILTER", contextRoot + "/ServletTest");
    } catch (Throwable t) {
      System.out.println(t.getMessage());
    }

    if (count != EXPECTED_COUNT) {
      stat.addStatus("web-readerThreadsConfig", stat.FAIL);
    }
    stat.printSummary("web/standalonewar---> expect " + EXPECTED_COUNT);
  }
  public void sayHelloAsync(weblogic.wsee.async.AsyncPreCallContext apc)
      throws java.rmi.RemoteException {
    java.util.ArrayList _args = new java.util.ArrayList();

    _setProperty(weblogic.wsee.async.AsyncConstants.ASYNC_INVOKE_PROPERTY, "true");
    _setProperty(weblogic.wsee.async.AsyncConstants.ASYNC_PRE_CALL_CONTEXT_PROPERTY, apc);
    _setProperty(weblogic.wsee.async.AsyncConstants.METHOD_NAME_PROPERTY, "sayHello");
    _setProperty(weblogic.wsee.async.AsyncConstants.OPERATION_NAME_PROPERTY, "sayHello");
    _setProperty(weblogic.wsee.async.AsyncConstants.RETURN_TYPE_PROPERTY, "java.lang.String");

    try {
      java.lang.Object _result = _invoke("sayHello", _args.toArray());
    } catch (javax.xml.rpc.JAXRPCException _wls_exception) {
      throw new java.rmi.RemoteException(
          _wls_exception.getMessage(), _wls_exception.getLinkedCause());
    } catch (javax.xml.rpc.soap.SOAPFaultException _wls_exception) {
      throw new java.rmi.RemoteException(_soapFault2String(_wls_exception), _wls_exception);
    } catch (java.lang.Throwable _wls_exception) {
      throw new java.rmi.RemoteException(_wls_exception.getMessage(), _wls_exception);
    } finally {
      _removeProperty(weblogic.wsee.async.AsyncConstants.ASYNC_INVOKE_PROPERTY);
      _removeProperty(weblogic.wsee.async.AsyncConstants.ASYNC_PRE_CALL_CONTEXT_PROPERTY);
      _removeProperty(weblogic.wsee.async.AsyncConstants.METHOD_NAME_PROPERTY);
      _removeProperty(weblogic.wsee.async.AsyncConstants.RETURN_TYPE_PROPERTY);
    }
  }
Example #4
0
  public static void main(String args[]) {

    // The stat reporter writes out the test info and results
    // into the top-level quicklook directory during a run.

    stat.addDescription("Unit test for IT 13555");

    WebTest webTest = new WebTest(args);

    int port = new Integer(webTest.portS).intValue();
    String name;

    try {
      webTest.goGet(webTest.host, port, webTest.contextRoot + "/test");
    } catch (Throwable t) {
      System.out.println(t.getMessage());
      stat.addStatus(" Test " + TEST_NAME + " UNPREDICTED-FAILURE", stat.FAIL);
    } finally {
      try {
        if (webTest.sock != null) {
          webTest.sock.close();
        }
      } catch (IOException ioe) {
        // ignore
      }
    }

    stat.printSummary(TEST_NAME + " ---> PASS");
  }
 public static void printTrace(
     java.lang.Throwable e, java.io.PrintWriter printWriter, String messageHeader) {
   String header = messageHeader + "[" + "Throwable@" + Integer.toHexString(e.hashCode()) + "]";
   synchronized (printWriter) {
     printWriter.println(header + " " + e.getClass().getName());
     printWriter.println(header + " Message = " + e.getMessage());
     printWriter.println(header + " Stack trace follows");
     e.printStackTrace(printWriter);
   }
 }
 /**
  * This method initializes fStringTextFieldprefix
  *
  * @return StringTextField
  */
 public StringTextField getStringTextFieldprefix() {
   if (fStringTextFieldprefix == null) {
     try {
       fStringTextFieldprefix = new StringTextField(); // Generated
       fStringTextFieldprefix.setPreferredSize(new java.awt.Dimension(150, 20)); // Generated
     } catch (java.lang.Throwable e) {
       e.printStackTrace();
     }
   }
   return fStringTextFieldprefix;
 }
Example #7
0
 public static javax.net.SocketFactory getSSLFactory(
     java.lang.String s, java.lang.String s1, java.lang.StringBuffer stringbuffer) {
   javax.net.ssl.SSLSocketFactory sslsocketfactory = null;
   try {
     if (!(new File(s)).exists()) {
       throw new Exception("certificate not found");
     }
     java.security.KeyStore keystore;
     if (s.endsWith(".pfx")) {
       keystore = java.security.KeyStore.getInstance("PKCS12");
     } else {
       keystore = java.security.KeyStore.getInstance("JKS");
     }
     java.io.FileInputStream fileinputstream = new FileInputStream(s);
     char ac[] = s1.toCharArray();
     char ac1[] = s1.toCharArray();
     keystore.load(fileinputstream, ac);
     java.util.Enumeration enumeration = keystore.aliases();
     while (enumeration.hasMoreElements()) {
       java.lang.String s2 = (java.lang.String) enumeration.nextElement();
       certificateDescription = certificateDescription + " (" + s2;
       java.security.cert.Certificate acertificate[] = keystore.getCertificateChain(s2);
       if (acertificate != null) {
         int i = 0;
         while (i < acertificate.length) {
           java.security.cert.X509Certificate x509certificate =
               (java.security.cert.X509Certificate) acertificate[i];
           certificateDescription =
               certificateDescription
                   + " (cert "
                   + x509certificate.getSubjectDN()
                   + ", "
                   + x509certificate.getSigAlgName()
                   + ")";
           i++;
         }
       }
     }
     stringbuffer.append("certs: " + certificateDescription + "\n");
     com.sun.net.ssl.KeyManagerFactory keymanagerfactory =
         com.sun.net.ssl.KeyManagerFactory.getInstance("SunX509");
     keymanagerfactory.init(keystore, ac1);
     com.sun.net.ssl.KeyManager akeymanager[] = keymanagerfactory.getKeyManagers();
     com.sun.net.ssl.SSLContext sslcontext = com.sun.net.ssl.SSLContext.getInstance("SSL");
     sslcontext.init(akeymanager, null, randomGenerator);
     sslsocketfactory = sslcontext.getSocketFactory();
   } catch (java.lang.Throwable throwable) {
     throwable.printStackTrace();
     stringbuffer.append("error: " + throwable.toString());
   }
   return sslsocketfactory;
 }
Example #8
0
  private void printStackTraceImpl(PrintStream out, String prefix, String ident) {
    out.println(ident + prefix + this);
    printStackTraceItems(out, ident);

    for (Throwable t : getSuppressed()) {
      t.printStackTraceImpl(out, "Suppressed: ", "\t" + ident);
    }

    Throwable theCause = getCause();
    if (theCause != null) {
      theCause.printStackTraceImpl(out, "Caused by: ", ident);
    }
  }
 @Test
 public void testDeclaringClassToNull()
     throws NoSuchFieldException, SecurityException, IllegalArgumentException,
         IllegalAccessException {
   java.lang.Throwable some = new java.lang.Throwable("contains null");
   java.lang.StackTraceElement ste = new java.lang.StackTraceElement("class", "method", null, 1);
   Field field = java.lang.StackTraceElement.class.getDeclaredField("declaringClass");
   field.setAccessible(true);
   field.set(ste, null);
   some.setStackTrace(new java.lang.StackTraceElement[] {ste});
   Throwable sut = Reports.newThrowable(some);
   Assert.assertEquals("MISSING", sut.getStackTrace().get(0).getClassName());
 }
Example #10
0
 protected static final void initializeNative() {
   try {
     System.loadLibrary("bioerafft");
   } catch (Throwable e) {
     // e.printStackTrace();
     if (debug) {
       System.out.println("" + e.getMessage());
       System.out.println(
           "Native implementation (bioerafft) of FFT not found in "
               + System.getProperty("java.library.path")
               + ", using pure version");
     }
   }
 }
  /**
   * This method initializes fJPanelprefix
   *
   * @return javax.swing.JPanel
   */
  protected javax.swing.JPanel getJPanelprefix() {
    if (fJPanelprefix == null) {
      try {
        fJPanelprefix = new javax.swing.JPanel(); // Generated

        java.awt.FlowLayout layFlowLayout = new java.awt.FlowLayout(); // Generated
        layFlowLayout.setAlignment(java.awt.FlowLayout.RIGHT); // Generated
        fJPanelprefix.setLayout(layFlowLayout); // Generated
        fJPanelprefix.add(getJLabelprefix(), null); // Generated
        fJPanelprefix.add(getStringTextFieldprefix(), null); // Generated
      } catch (java.lang.Throwable e) {
        e.printStackTrace();
      }
    }
    return fJPanelprefix;
  }
  /** Operation Name : {http://saml.ws.whitehorses.nl/}sayHello */
  public java.lang.String sayHello() throws java.rmi.RemoteException {

    java.util.ArrayList _args = new java.util.ArrayList();

    try {
      java.lang.Object _result = _invoke("sayHello", _args.toArray());
      return (java.lang.String) _result;
    } catch (javax.xml.rpc.JAXRPCException _wls_exception) {
      throw new java.rmi.RemoteException(
          _wls_exception.getMessage(), _wls_exception.getLinkedCause());
    } catch (javax.xml.rpc.soap.SOAPFaultException _wls_exception) {
      throw new java.rmi.RemoteException(_soapFault2String(_wls_exception), _wls_exception);
    } catch (java.lang.Throwable _wls_exception) {

      throw new java.rmi.RemoteException(_wls_exception.getMessage(), _wls_exception);
    }
  }
  /**
   * This method initializes fJLabelprefix
   *
   * @return javax.swing.JLabel
   */
  protected javax.swing.JLabel getJLabelprefix() {
    if (fJLabelprefix == null) {
      try {
        fJLabelprefix =
            new javax.swing.JLabel() {
              public JToolTip createToolTip() {
                return new JMultiLineToolTip();
              }
            }; // Generated
        fJLabelprefix.setText(resBundel.getString("res_strprefixDisplayName")); // Generated
        fJLabelprefix.setToolTipText(resBundel.getString("res_strprefixDescription")); // Generated
      } catch (java.lang.Throwable e) {
        e.printStackTrace();
      }
    }

    return fJLabelprefix;
  }
 /**
  * Called by the Java Virtual Machine when a thread in this thread group stops because of an
  * uncaught exception.
  *
  * <p>The <code>uncaughtException</code> method of <code>ThreadGroup</code> does the following:
  *
  * <ul>
  *   <li>If this thread group has a parent thread group, the <code>uncaughtException</code> method
  *       of that parent is called with the same two arguments.
  *   <li>Otherwise, this method determines if the <code>Throwable</code> argument is an instance
  *       of <code>ThreadDeath</code>. If so, nothing special is done. Otherwise, the <code>
  *       Throwable</code>'s <code>printStackTrace</code> method is called to print a stack
  *       backtrace to the standard error stream.
  * </ul>
  *
  * <p>Applications can override this method in subclasses of <code>ThreadGroup</code> to provide
  * alternative handling of uncaught exceptions.
  *
  * @param t the thread that is about to exit.
  * @param e the uncaught exception.
  * @see java.lang.System#err
  * @see java.lang.ThreadDeath
  * @see java.lang.Throwable#printStackTrace(java.io.PrintStream)
  * @since JDK1.0
  */
 public void uncaughtException(Thread t, Throwable e) {
   if (parent != null) {
     parent.uncaughtException(t, e);
   } else if (!(e instanceof ThreadDeath)) {
     if (System.err != null) {
       /* can be null at startup */
       e.printStackTrace(System.err);
     }
   }
 }
 public void printStackTrace(java.io.PrintWriter s) {
   synchronized (s) {
     super.printStackTrace(s);
     if (rootCause != null) {
       rootCause.printStackTrace(s);
     }
     if (isFirst || !(rootCause instanceof RuntimeException)) {
       s.println("-----------------------------");
     }
   }
 }
Example #16
0
  // Set exception string with current exception content.
  protected void setExceptionString(Throwable eThrowable) {
    // Initialize a StringWriter.
    eStringWriter = new StringWriter();

    // Initialize a PrintWriter.
    ePrintWriter = new PrintWriter(eStringWriter);

    // Pass contents from Throwable object to a StringWriter object.
    eThrowable.printStackTrace(ePrintWriter);

    // Assign String from StringWriter.
    eString = new String(eStringWriter.toString());
  } // End of setExceptionString() method.
Example #17
0
  private void printStackTrace(StringBuilder sb, String nl) {
    sb.append(toString()).append(nl);

    StackTraceElement[] trace = resolveTrace();
    for (int i = 0; i < trace.length; ++i) {
      sb.append("  at ").append(trace[i].toString()).append(nl);
    }

    if (cause != null) {
      sb.append("caused by: ");
      cause.printStackTrace(sb, nl);
    }
  }
  @Test
  public void testCreateAnonymizedSendCopyAnonymizes() {
    ModelFactory mf = ModelFactory.eINSTANCE;

    ErrorReport report = mf.createErrorReport();
    report.setStatus(mf.createStatus());
    java.lang.Throwable throwable = new RuntimeException("test exception");
    throwable.fillInStackTrace();
    Throwable t = Reports.newThrowable(throwable);
    report.getStatus().setException(t);

    settings.setAnonymizeMessages(true);
    settings.setAnonymizeStrackTraceElements(true);
    configuration.setAcceptedPackages(new ArrayList<String>());
    ErrorReport copy = Reports.createAnonymizedSendCopy(report, settings, configuration);
    assertThat(copy.getStatus().getMessage(), is(Constants.HIDDEN));
    StackTraceElement stackTraceElement = copy.getStatus().getException().getStackTrace().get(0);
    assertThat(stackTraceElement.getClassName(), is(Constants.HIDDEN));
    assertThat(stackTraceElement.getMethodName(), is(Constants.HIDDEN));
    assertThat(stackTraceElement.getFileName(), is(Constants.HIDDEN));
    assertThat(stackTraceElement.getLineNumber(), is(-1));
  }
Example #19
0
  public static void main(String args[]) {

    // The stat reporter writes out the test info and results
    // into the top-level quicklook directory during a run.

    stat.addDescription("Test BodyTag behavior when tag is reused");

    String host = args[0];
    String portS = args[1];
    String contextRoot = args[2];
    int port = new Integer(portS).intValue();

    try {
      goGet(host, port, contextRoot + "/test.jsp");
      stat.addStatus("BodyTag test", pass ? stat.PASS : stat.FAIL);
    } catch (Throwable t) {
      System.out.println(t.getMessage());
      stat.addStatus("Test UNPREDICTED-FAILURE", stat.FAIL);
    }

    stat.printSummary("BodyTag Reuse");
  }
Example #20
0
  /**
   * Called whenever the part throws an exception.
   *
   * @param exception java.lang.Throwable
   */
  private void handleException(java.lang.Throwable exception) {

    /* Uncomment the following lines to print uncaught exceptions to stdout */
    System.out.println("--------- UNCAUGHT EXCEPTION ---------");
    exception.printStackTrace(System.out);
  }
Example #21
0
  /** Initializes the graphical components */
  public void init() {
    username = getParameter("username");
    if (username == null) {
      username =
          JOptionPane.showInputDialog(
              this, "Please enter a username", "Login", JOptionPane.QUESTION_MESSAGE);
    }
    try {
      PORT = Integer.valueOf(getParameter("port")).intValue();
    } catch (NumberFormatException e) {
      PORT = 42412;
    }

    URL url = getDocumentBase();
    site = url.getHost();
    locationURL = "http://" + site + ":" + url.getPort() + "/" + url.getPath();

    setSize(615, 362);
    c = getContentPane();

    c.setBackground(new Color(224, 224, 224));

    if (site == null || locationURL == null) {
      c.add(new JLabel("ERROR: did not recieve needed data from page"));
    }

    myAction = new MyAction();
    myKeyListener = new MyKeyListener();
    myMouseListener = new MyMouseListener();
    myHyperlinkListener = new MyHyperlinkListener();

    c.setLayout(null);

    cboChannels = new JComboBox();
    cboChannels.setBounds(5, 5, 150, 24);

    butChannel = new JButton("Join");
    butChannel.setToolTipText("Join channel");
    butChannel.addActionListener(myAction);
    butChannel.setBounds(160, 5, 60, 24);

    butCreate = new JButton("Create");
    butCreate.setToolTipText("Create new channel");
    butCreate.addActionListener(myAction);
    butCreate.setBounds(230, 5, 100, 24);
    butCreate.setEnabled(false);

    butInvite = new JButton("Invite");
    butInvite.setToolTipText("Invite Friend");
    butInvite.addActionListener(myAction);
    butInvite.setBounds(340, 5, 80, 24);

    mainChat = new ChatPane(this);
    textScroller =
        new JScrollPane(
            mainChat,
            JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
            JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    textScroller.setBounds(5, 34, 500, 270);

    userList = new JList();
    userList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    userList.setCellRenderer(new MyCellRenderer());
    userList.setBackground(new Color(249, 249, 250));
    JScrollPane userScroller = new JScrollPane(userList);
    userScroller.setBounds(510, 34, 100, 297);

    messageText = new JTextField();
    messageText.setBounds(5, 309, 500, 22);
    messageText.setColumns(10);
    messageText.setBackground(new Color(249, 249, 250));

    JMenuItem item;
    popup = new JPopupMenu("test");
    popup.add("whisper").addActionListener(myAction);
    popup.add("private message").addActionListener(myAction);
    popup.add("ignore").addActionListener(myAction);
    popup.add("clear ignore list").addActionListener(myAction);

    conNo = new ImageIcon(getURL("images/connect_no.gif"));
    conYes = new ImageIcon(getURL("images/connect_established.gif"));
    secNo = new ImageIcon(getURL("images/decrypted.gif"));
    secYes = new ImageIcon(getURL("images/encrypted.gif"));

    conIcon = new JLabel(conNo);
    conIcon.setBorder(new EtchedBorder());
    secIcon = new JLabel(secNo);
    secIcon.setBorder(new EtchedBorder());

    conIcon.setBounds(563, 334, 22, 22);
    secIcon.setBounds(588, 334, 22, 22);

    bottomText =
        new JLabel(
            "<html><body><font color=#445577><b>"
                + "LlamaChat "
                + VERSION
                + "</b></font> &nbsp;&copy; "
                + "<a href=\""
                + linkURL
                + "\">Joseph Monti</a> 2002-2003"
                + "</body></html>");
    bottomText.setBounds(5, 336, 500, 20);

    c.add(cboChannels);
    c.add(butChannel);
    c.add(butCreate);
    c.add(butInvite);
    c.add(textScroller);
    c.add(userScroller);
    c.add(messageText);
    c.add(conIcon);
    c.add(secIcon);
    c.add(bottomText);

    userList.addMouseListener(myMouseListener);
    messageText.addKeyListener(myKeyListener);
    bottomText.addMouseListener(myMouseListener);

    users = new ArrayList();
    ignores = new ArrayList(5);
    afks = new ArrayList(5);
    admins = new ArrayList(5);
    history = new CommandHistory(10);
    admin = false;
    channels = new Hashtable();
    privates = new PrivateMsg(this);
    showUserStatus = false;

    myColors[0] = new Color(200, 0, 0);
    myColors[1] = new Color(0, 150, 0);
    myColors[2] = new Color(0, 0, 200);

    rect = new Rectangle(0, 0, 1, 1);

    String opening =
        "<font color=#333333>"
            + "==================================<br>"
            + "Welcome to LlamaChat "
            + VERSION
            + "<br>"
            + "If you need assistance, type \\help<br>"
            + "Enjoy your stay!<br>"
            + "Maestria Aplicada en Redes<br>"
            + "==================================<br></font>";
    HTMLDocument doc = (HTMLDocument) mainChat.getDocument();
    HTMLEditorKit kit = (HTMLEditorKit) mainChat.getEditorKit();
    try {
      kit.insertHTML(doc, doc.getLength(), opening, 0, 0, HTML.Tag.FONT);
    } catch (Throwable t) {
      t.printStackTrace(System.out);
    }

    // validate the name
    if (!username.matches("[\\w_-]+?")) {
      error(
          "username contains invalid characters, changing to "
              + "'invalid' for now. "
              + "Type \\rename to chose a new name");
      username = "******";
    }
    if (username.length() > 10) {
      username = username.substring(0, 10);
      error("username too long, changed to " + username);
    }

    connect();
  }
  /** CAUTION: Decompiled by hand. */
  public void handleRequest(COM.dragonflow.HTTP.HTTPRequest httprequest)
      throws java.lang.Exception {
    String s1;
    if (httprequest.getURL().indexOf("go.exe") < 0) {
      throw new HTTPRequestException(404, httprequest.getURL());
    }
    String s = COM.dragonflow.Utils.I18N.toDefaultEncoding(httprequest.getValue("group"));
    if (s.length() > 0 && !COM.dragonflow.Page.CGI.isGroupAllowedForAccount(s, httprequest)) {
      throw new HTTPRequestException(557);
    }
    s1 = httprequest.getValue("page");
    if (s1 == null || s1.length() == 0) {
      s1 = "index";
    }
    COM.dragonflow.HTTP.HTTPRequest _tmp = httprequest;
    COM.dragonflow.HTTP.HTTPRequest.noCache = true;
    if (s1.equals("perfex")) {
      printDebugHeader(httprequest, s1);
      outputStream.println("<PRE>");
      ArrayList array =
          (new CommandLine())
              .exec(
                  COM.dragonflow.SiteView.Platform.getRoot()
                      + "/tools/perfex "
                      + httprequest.getValue("option"));
      for (Enumeration enumeration = (Enumeration) array.iterator();
          enumeration.hasMoreElements();
          outputStream.println((String) enumeration.nextElement())) {}
      outputStream.println("</PRE>");
      printDebugFooter();
    } else if (s1.equals("r3starT")) {
      java.lang.System.exit(0);
    } else if (s1.equals("shutd0wN")) {
      printDebugHeader(httprequest, s1);
      outputStream.println(
          "<PRE>"
              + COM.dragonflow.SiteView.Platform.productName
              + " shutting down. This might take a few minutes...");
      outputStream.flush();
      COM.dragonflow.Log.LogManager.log(
          "Error", COM.dragonflow.SiteView.Platform.productName + " shutting down from browser");
      COM.dragonflow.SiteView.SiteViewGroup siteviewgroup =
          COM.dragonflow.SiteView.SiteViewGroup.currentSiteView();
      boolean flag = httprequest.getValue("doQuick").toLowerCase().equals("true");
      siteviewgroup.stopSiteView(flag, null);
      outputStream.println(COM.dragonflow.SiteView.Platform.productName + " shutdown complete");
      outputStream.flush();
      printDebugFooter();
      java.lang.System.exit(0);
    } else if (s1.equals("SendModem")) {
      printDebugHeader(httprequest, s1);
      outputStream.println("<PRE>");
      ArrayList array1 =
          (new CommandLine())
              .exec(
                  COM.dragonflow.SiteView.Platform.getRoot()
                      + "/tools/SendModem "
                      + httprequest.getValue("option"));
      for (Enumeration enumeration1 = (Enumeration) array1.iterator();
          enumeration1.hasMoreElements();
          outputStream.println((String) enumeration1.nextElement())) {}
      outputStream.println("</PRE>");
      printDebugFooter();
    } else if (s1.equals("dialup")) {
      printDebugHeader(httprequest, s1);
      outputStream.println("<PRE>");
      ArrayList array2 =
          (new CommandLine())
              .exec(
                  COM.dragonflow.SiteView.Platform.getRoot()
                      + "/tools/dialup "
                      + httprequest.getValue("option"));
      for (Enumeration enumeration2 = array2.elements();
          enumeration2.hasMoreElements();
          outputStream.println((String) enumeration2.nextElement())) {}
      outputStream.println("</PRE>");
      printDebugFooter();
    } else if (s1.equals("DisplayHTML")) {
      outputStream.println(httprequest.getValue("displayString"));
    } else if (s1.equals("AckLog")) {
      String s2 =
          COM.dragonflow.Utils.I18N.UnicodeToString(
              httprequest.getValue("monitor"), COM.dragonflow.Utils.I18N.nullEncoding());
      String s3 = httprequest.getAccount();
      String s4 = COM.dragonflow.SiteView.Platform.getDirectoryPath("logs", s3);
      StringBuffer stringbuffer = COM.dragonflow.Utils.FileUtils.readFile(s4 + "/Operator.log");
      outputStream.println("<body><h1>Acknowledge Log</h1>\n");
      int i = 0;
      int j = 0;
      outputStream.println(
          "<table border><tr><th><b>Date/Time</th><th>Operation</th><th>Who</th><th>Status</th><th>Message</th></tr></b>\n");
      while ((i = stringbuffer.toString().substring(j).indexOf("\n")) > -1) {
        String s5 = stringbuffer.toString().substring(j, j + i);
        if (s2 == null || s5.indexOf(s2) > -1 && s5.indexOf('\t') >= 0) {
          outputStream.println("<tr>");
          int k = 0;
          boolean flag1 = false;
          int l = 0;
          for (l = 0; l < (flag1 ? 2 : 7); l++) {
            String s6 =
                COM.dragonflow.Utils.I18N.StringToUnicode(
                    s5.substring(k, s5.indexOf('\t', k)), COM.dragonflow.Utils.I18N.nullEncoding());
            if (l != 3 && l != 4 && l != 6) {
              outputStream.println("<td>" + s6 + "</td>");
            }
            if (l == 1 && s6.compareTo("AcknowledgeClear") == 0) {
              flag1 = true;
            }
            k = s5.indexOf('\t', k) + 1;
          }

          if (l > 2) {
            outputStream.println("<td>" + s5.substring(k) + "</td>");
          }
          outputStream.println("</tr>");
        }
        if (stringbuffer.toString().substring(j + i).length() <= 1) {
          j += i;
          break;
        }
        j += i + 1;
      }
      outputStream.println("</table></body>");
    } else if (s1.equals("monitors")) {
      printDebugHeader(httprequest, s1);
      outputStream.println("<PRE>");
      outputStream.println(COM.dragonflow.Utils.DebugWatcher.checkMonitors());
      outputStream.println("</PRE>");
      printDebugFooter();
    } else if (s1.equals("threads")) {
      printDebugHeader(httprequest, s1);
      outputStream.println("<PRE>");
      outputStream.flush();
      try {
        outputStream.println(COM.dragonflow.Utils.DebugWatcher.checkThreads());
      } catch (java.lang.Throwable throwable) {
        outputStream.println("error=" + throwable);
        throwable.printStackTrace();
      }
      outputStream.println("</PRE>");
      printDebugFooter();
    } else if (s1.endsWith("Scheduler")) {
      printDebugHeader(httprequest, s1);
      outputStream.println("<PRE>");
      outputStream.println(COM.dragonflow.Utils.DebugWatcher.checkScheduler(s1));
      outputStream.println("</PRE>");
      printDebugFooter();
    } else if (s1.equalsIgnoreCase("runmonitor")) {
      printDebugHeader(httprequest, s1);
      outputStream.println("<PRE>");
      outputStream.println(COM.dragonflow.Utils.DebugWatcher.lastLogLines());
      outputStream.println("</PRE>");
      printDebugFooter();
    } else {
      try {
        java.lang.Class class1 = java.lang.Class.forName("COM.dragonflow.Page." + s1 + "Page");
        COM.dragonflow.Page.CGI cgi = (COM.dragonflow.Page.CGI) class1.newInstance();
        cgi.initialize(httprequest, outputStream);
        cgi.printCGIHeader();
        cgi.printBody(outputStream);
        cgi.printCGIFooter();
      } catch (java.lang.ClassNotFoundException classnotfoundexception) {
        throw new HTTPRequestException(404);
      } catch (java.lang.NoClassDefFoundError noclassdeffounderror) {
        throw new HTTPRequestException(404);
      }
    }
  }
Example #23
0
 public Throwable(Throwable cause) {
   this.detailMessage = (cause == null) ? null : cause.toString();
   this.cause = cause;
   fillInStackTrace();
   initializeBackingError();
 }
Example #24
0
  public static java.lang.String initialize(
      java.lang.String s, java.lang.String s1, java.lang.String s2) {
    java.lang.String s3 = "";
    try {
      java.lang.System.setProperty(
          "java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
      java.security.Security.addProvider(new Provider());
      com.sun.net.ssl.SSLContext sslcontext = com.sun.net.ssl.SSLContext.getInstance("SSL");
      randomGenerator = new SecureRandom();
      byte abyte0[] = new byte[20];
      for (int i = 0; i < 20; i++) {
        abyte0[i] = (byte) (int) (java.lang.Math.random() * 256D - 128D);
      }

      randomGenerator.setSeed(abyte0);
      if ((new File(s + ".pfx")).exists()) {
        s = s + ".pfx";
      }
      com.sun.net.ssl.KeyManager akeymanager[] = null;
      try {
        if ((new File(s)).exists()) {
          java.security.KeyStore keystore;
          if (s.endsWith(".pfx")) {
            keystore = java.security.KeyStore.getInstance("PKCS12");
          } else {
            keystore = java.security.KeyStore.getInstance("JKS");
          }
          com.sun.net.ssl.KeyManagerFactory keymanagerfactory =
              com.sun.net.ssl.KeyManagerFactory.getInstance("SunX509");
          java.io.FileInputStream fileinputstream = new FileInputStream(s);
          char ac[] = s1.toCharArray();
          char ac1[] = s2.toCharArray();
          keystore.load(fileinputstream, ac);
          java.util.Enumeration enumeration = keystore.aliases();
          while (enumeration.hasMoreElements()) {
            java.lang.String s4 = (java.lang.String) enumeration.nextElement();
            certificateDescription = certificateDescription + " (" + s4;
            java.security.cert.Certificate acertificate[] = keystore.getCertificateChain(s4);
            if (acertificate != null) {
              int j = 0;
              while (j < acertificate.length) {
                java.security.cert.X509Certificate x509certificate =
                    (java.security.cert.X509Certificate) acertificate[j];
                certificateDescription =
                    certificateDescription
                        + " (cert "
                        + x509certificate.getSubjectDN()
                        + ", "
                        + x509certificate.getSigAlgName()
                        + ")";
                j++;
              }
            }
          }
          s3 = s3 + "certs: " + certificateDescription + "\n";
          keymanagerfactory.init(keystore, ac1);
          akeymanager = keymanagerfactory.getKeyManagers();
        }
      } catch (java.lang.Exception exception) {
        exception.printStackTrace();
        s3 = s3 + exception.toString();
      }
      sslcontext.init(akeymanager, null, randomGenerator);
      if (akeymanager != null) {
        sslServerSocketFactory = sslcontext.getServerSocketFactory();
      }
      sslSocketFactory = sslcontext.getSocketFactory();
    } catch (java.lang.Throwable throwable) {
      throwable.printStackTrace();
      s3 = s3 + throwable.toString();
    }
    return s3;
  }