You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by qu...@apache.org on 2003/01/09 23:40:13 UTC

cvs commit: jakarta-turbine-2/src/java/org/apache/turbine/services/intake/transform DTDResolver.java

quintonm    2003/01/09 14:40:13

  Modified:    src/java/org/apache/turbine/services/intake/transform
                        DTDResolver.java
  Log:
  - changed the variable name
    databaseDTD to intakeDTD
  - Exceptoin will be written to the log instead
    of System.out
  
  Revision  Changes    Path
  1.3       +13 -8     jakarta-turbine-2/src/java/org/apache/turbine/services/intake/transform/DTDResolver.java
  
  Index: DTDResolver.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-2/src/java/org/apache/turbine/services/intake/transform/DTDResolver.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DTDResolver.java	3 Jan 2003 07:20:43 -0000	1.2
  +++ DTDResolver.java	9 Jan 2003 22:40:13 -0000	1.3
  @@ -72,6 +72,7 @@
    *
    * @author <a href="mailto:mpoeschl@marmot.at">Martin Poeschl</a>
    * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
  + * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
    * @version $Id$
    */
   public class DTDResolver implements EntityResolver
  @@ -79,8 +80,8 @@
       private static final String WEB_SITE_DTD =
               "http://jakarta.apache.org/turbine/dtd/intake.dtd";
   
  -    /** InputSource for <code>database.dtd</code>. */
  -    private InputSource databaseDTD = null;
  +    /** InputSource for <code>intake.dtd</code>. */
  +    private InputSource intakeDTD = null;
   
       /** Logging */
       private static Log log = LogFactory.getLog(DTDResolver.class);
  @@ -100,12 +101,16 @@
               // getResourceAsStream works on linux, maybe others?
               if (dtdStream != null)
               {
  -                databaseDTD = new InputSource(dtdStream);
  +                intakeDTD = new InputSource(dtdStream);
  +            }
  +            else
  +            {
  +                log.warn("Could not located the intake.dtd");
               }
           }
           catch (Exception ex)
           {
  -            ex.printStackTrace();
  +            log.error("Could not get stream for dtd", ex );
           }
       }
   
  @@ -116,7 +121,7 @@
        */
       public InputSource resolveEntity(String publicId, String systemId)
       {
  -        if (databaseDTD != null && WEB_SITE_DTD.equals(systemId))
  +        if (intakeDTD != null && WEB_SITE_DTD.equals(systemId))
           {
               String pkg = getClass().getName()
                       .substring(0, getClass().getName().lastIndexOf("."));
  @@ -124,7 +129,7 @@
               log.info("Resolver: used intake.dtd from " +
                       pkg + " package ");
   
  -            return databaseDTD;
  +            return intakeDTD;
           }
           else if (systemId == null)
           {
  @@ -153,7 +158,7 @@
           }
           catch (IOException ex)
           {
  -            ex.printStackTrace();
  +            log.error("Could not get InputSource for "+urlString, ex);
           }
           return new InputSource();
       }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>