Diff for /java/classes/org/w3c/rdf/examples/ARPServlet.java between versions 1.19 and 1.20

version 1.19, 2002/08/05 05:57:06 version 1.20, 2002/08/05 07:02:43
Line 747  public class ARPServlet extends HttpServ Line 747  public class ARPServlet extends HttpServ
     {      {
         try {          try {
             out.println("<hr title=\"original source\">" +              out.println("<hr title=\"original source\">" +
                         "<h3>The original RDF/XML document</h3>" +                          "<h3>The original RDF/XML document @@@mjd@@@</h3>" +
                         "<pre>");                          "<pre>");
   
             String s = replaceString(rdf, "<", "&lt;");              String s = replaceString(rdf, "<", "&lt;");
Line 890  public class ARPServlet extends HttpServ Line 890  public class ARPServlet extends HttpServ
   
         m_GraphVizPath = GraphVizRoot + "/" + config.getInitParameter(GRAPH_VIZ_PATH);          m_GraphVizPath = GraphVizRoot + "/" + config.getInitParameter(GRAPH_VIZ_PATH);
         m_GraphVizFontDir = GraphVizRoot + "/" + config.getInitParameter(GRAPH_VIZ_FONT_DIR);          m_GraphVizFontDir = GraphVizRoot + "/" + config.getInitParameter(GRAPH_VIZ_FONT_DIR);
   System.out.println("GRAPH_VIZ_ROOT   = " + GraphVizRoot);
   System.out.println("GRAPH_VIZ_PATH   = " + m_GraphVizPath);
   System.out.println("GRAPH_VIZ_FNTDIR = " + m_GraphVizFontDir);
   System.out.println("SERVLET_TMP_DIR  = " + m_ServletTmpDir);
   
         if (m_ServletTmpDir == null || GraphVizRoot == null) {          if (m_ServletTmpDir == null || GraphVizRoot == null) {
             System.err.println (              System.err.println (
Line 932  public class ARPServlet extends HttpServ Line 936  public class ARPServlet extends HttpServ
             return;              return;
         }          }
   
         process(req, res,           try {
                 (sRDF != null) ? java.net.URLDecoder.decode(sRDF) : null,               process(req, res, 
                 (sURI != null) ? java.net.URLDecoder.decode(sURI) : null);                      (sRDF != null) ? java.net.URLDecoder.decode(sRDF) : null, 
                       (sURI != null) ? java.net.URLDecoder.decode(sURI) : null);
           } catch (Exception e) {
               System.err.println("Exception: URLDecoder.decode()");
           }
     }      }
   
     /*      /*
Line 1001  public class ARPServlet extends HttpServ Line 1009  public class ARPServlet extends HttpServ
      *@return the padded string       *@return the padded string
      */       */
      // MJD: is there an easier way to do this?       // MJD: is there an easier way to do this?
     static private String hexPadd (Integer number, Integer length)      static private String hexPadd (int number, int length)
     {      {
         String t = Integer.toHexString(number).toUpperCase();          String t = Integer.toHexString(number).toUpperCase();
         Integer hexlength = t.length();          int hexlength = t.length();
   
         if ( hexlength > length ) {    // too long, truncate          if ( hexlength > length ) {    // too long, truncate
             hexlength = length;              hexlength = length;
         }          }
   
         Integer zerolength = length - hexlength;          int zerolength = length - hexlength;
         String r = "";          String r = "";
   
         for (int i=0; i < zerolength; i++) {          for (int i=0; i < zerolength; i++) {
Line 1055  public class ARPServlet extends HttpServ Line 1063  public class ARPServlet extends HttpServ
                         if ( ar[i] >= 32 && ar[i] <= 127 )                          if ( ar[i] >= 32 && ar[i] <= 127 )
                             out.print(ar[i]);                              out.print(ar[i]);
                         else if ( ar[i] < 0xD800 || ar[i] >= 0xE000)                          else if ( ar[i] < 0xD800 || ar[i] >= 0xE000)
                             out.print("\\u" + hexPadd(Integer.toHexString(ar[i]).toUpperCase(), 4) );                              out.print("\\u" + hexPadd(ar[i], 4) );
                         else // deal with surrogates {                          else // deal with surrogates {
                             // check for correct surrogate pair                              // check for correct surrogate pair
                             // this code should probably move somewhere else:                              // this code should probably move somewhere else:
Line 1072  public class ARPServlet extends HttpServ Line 1080  public class ARPServlet extends HttpServ
                             // no errors, actually print                              // no errors, actually print
                             else {                              else {
                                 Integer scalarvalue = 0x10000 + (ar[i-1] * 1024) + ar[i];                                  Integer scalarvalue = 0x10000 + (ar[i-1] * 1024) + ar[i];
                                 out.print("\\U" + hexPadd(Integer.toHexString(scalarvalue).toUpperCase(), 8) );                                  out.print("\\U" + hexPadd(scalarvalue, 8) );
                             }                              }
                         }                          }
                 }                  }
Line 1505  public class ARPServlet extends HttpServ Line 1513  public class ARPServlet extends HttpServ
         String sRDF, String sURI) throws ServletException, IOException           String sRDF, String sURI) throws ServletException, IOException 
     {      {
         ServletOutputStream out = res.getOutputStream ();          ServletOutputStream out = res.getOutputStream ();
   
         res.setContentType ("text/html");          res.setContentType ("text/html");
   
         String sSaveRDF         = req.getParameter (SAVE_RDF);          String sSaveRDF         = req.getParameter (SAVE_RDF);

Removed from v.1.19  
changed lines
  Added in v.1.20


Webmaster