Diff for /java/classes/org/w3c/rdf/examples/ARPServlet.java between versions 1.4 and 1.5

version 1.4, 2001/08/12 01:27:04 version 1.5, 2001/08/12 01:54:29
Line 377  public class ARPServlet extends HttpServ Line 377  public class ARPServlet extends HttpServ
     {       { 
         ServletOutputStream out;          ServletOutputStream out;
         boolean silent = false;          boolean silent = false;
         String fatalErrors = null;          String fatalErrors = "";
         String errors = null;          String errors = "";
         String warning = null;          String warnings = "";
   
         /*          /*
          * Constructuor for a SaxErrorHandler            * Constructuor for a SaxErrorHandler 
Line 396  public class ARPServlet extends HttpServ Line 396  public class ARPServlet extends HttpServ
         /*          /*
          * Create a formatted string from the exception's message           * Create a formatted string from the exception's message
          *           *
          *@e the SAX Parse Exception           *@param e the SAX Parse Exception
          *@return a formatted string           *@return a formatted string
          */           */
         private static String format(org.xml.sax.SAXParseException e)           private static String format(org.xml.sax.SAXParseException e) 
Line 410  public class ARPServlet extends HttpServ Line 410  public class ARPServlet extends HttpServ
         /*          /*
          * Handle a parse error           * Handle a parse error
          *           *
          *@e the SAX Parse Exception           *@param e the SAX Parse Exception
          */           */
         public void error(org.xml.sax.SAXParseException e)           public void error(org.xml.sax.SAXParseException e) 
             throws org.xml.sax.SAXException               throws org.xml.sax.SAXException 
         {          {
             if (this.silent) return;              if (this.silent) return;
   
             try {               this.errors += "Error: " + format(e) + "<br />";
                 this.out.println("Parse Error: " + format(e) + "<br />");  
             } catch (IOException ioe) {  
                 System.err.println("IOException: printing parser error message.");  
             }  
         }          }
           
         /*          /*
          * Handle a fatal parse error           * Handle a fatal parse error
          *           *
          *@e the SAX Parse Exception           *@param e the SAX Parse Exception
          */           */
         public void fatalError(org.xml.sax.SAXParseException e)           public void fatalError(org.xml.sax.SAXParseException e) 
             throws org.xml.sax.SAXException               throws org.xml.sax.SAXException 
         {          {
             if (this.silent) return;              if (this.silent) return;
   
             try {               this.fatalErrors += "FatalError: " + format(e) + "<br />";
                 this.out.println("Fatal Parse Error: " + format(e) + "<br />");   
             } catch (IOException ioe) {  
                 System.err.println("IOException: printing parser fatal error message.");  
             }  
         }          }
           
         /*          /*
          * Handle a parse warning           * Handle a parse warning
          *           *
          *@e the SAX Parse Exception           *@param e the SAX Parse Exception
          */           */
         public void warning(org.xml.sax.SAXParseException e)           public void warning(org.xml.sax.SAXParseException e) 
             throws org.xml.sax.SAXException               throws org.xml.sax.SAXException 
         {          {
             if (this.silent) return;              if (this.silent) return;
   
             try {               this.warnings += "Warning: " + format(e) + "<br />";
                 this.out.println("Warning: " + format(e) + "<br />");   
             } catch (IOException ioe) {  
                 System.err.println("IOException: printing parser warning message.");  
             }  
         }          }
   
           /*
            * Return the error messages
            *
            *@return the error messages or an empty string if there are
            * no messages
            */
           public String getErrors()
           {
              return this.errors;
           }
   
           /*
            * Return the fatal error messages
            *
            *@return the fatal error messages or an empty string if there are
            * no messages
            */
           public String getFatalErrors()
           {
              return this.fatalErrors;
           }
   
           /*
            * Return the warning messages
            *
            *@return the warning messages or an empty string if there are
            * no messages
            */
           public String getWarnings()
           {
              return this.warnings;
           }
     }       } 
   
     /*      /*
Line 1121  public class ARPServlet extends HttpServ Line 1142  public class ARPServlet extends HttpServ
         }          }
     }      }
   
       private void printErrorMessages(ServletOutputStream out, 
           SaxErrorHandler eh)
       {
           try {
               String s;
   
               s = eh.getFatalErrors();
               if (s != null && s.length() >= 1)
                   out.println("<h2>Fatal Error Messages</h2>" + s);
   
               s = eh.getErrors();
               if (s != null && s.length() >= 1)
                   out.println("<h2>Error Messages</h2>" + s);
   
               s = eh.getWarnings();
               if (s != null && s.length() >= 1)
                   out.println("<h2>Warning Messages</h2>" + s);
           } catch (Exception e) {
               System.err.println(SERVLET_NAME + ": Error printing error messages.");
           }
       }
   
       /*
        * Initialize the graph output file.  If an error occurs, this
        * function will print an error message.
        *
        *@param out the servlet's output stream
        *@req the servlet request object
        *@return the File object for the graph file; null if an error occurs
        */
     private File initGraphFile(ServletOutputStream out,       private File initGraphFile(ServletOutputStream out, 
         HttpServletRequest req)          HttpServletRequest req)
     {      {
Line 1165  public class ARPServlet extends HttpServ Line 1216  public class ARPServlet extends HttpServ
   
         return dotFile;          return dotFile;
     }      }
   
           
     /*      /*
      * Handle the servlets doGet or doPut request       * Handle the servlets doGet or doPut request
Line 1269  public class ARPServlet extends HttpServ Line 1319  public class ARPServlet extends HttpServ
   
         printTripleTableFooter(out, nTriples);          printTripleTableFooter(out, nTriples);
   
           printErrorMessages(out, errorHandler);
   
         if (sError != null) {          if (sError != null) {
             out.println ("<h1>" + sError + "</h1>\n");              out.println ("<h1>" + sError + "</h1>\n");
             System.err.println(sError);              System.err.println(sError);

Removed from v.1.4  
changed lines
  Added in v.1.5


Webmaster