forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-forrest/src/scratchpad/src/java/org/apache/forrest/components/sourcetype SourceTypeAction.java
Date Fri, 29 Nov 2002 12:26:59 GMT
jefft       2002/11/29 04:26:59

  Modified:    src/scratchpad/src/java/org/apache/forrest/components/sourcetype
                        SourceTypeAction.java
  Log:
  Links to nonexistent files (eg PDFs) no longer cause the build to fail.
  
  Revision  Changes    Path
  1.4       +9 -1      xml-forrest/src/scratchpad/src/java/org/apache/forrest/components/sourcetype/SourceTypeAction.java
  
  Index: SourceTypeAction.java
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/scratchpad/src/java/org/apache/forrest/components/sourcetype/SourceTypeAction.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SourceTypeAction.java	28 Nov 2002 15:51:41 -0000	1.3
  +++ SourceTypeAction.java	29 Nov 2002 12:26:59 -0000	1.4
  @@ -69,7 +69,9 @@
   import org.apache.cocoon.environment.SourceResolver;
   import org.apache.cocoon.environment.Redirector;
   import org.apache.excalibur.source.Source;
  +import org.apache.excalibur.source.SourceNotFoundException;
   
  +import java.io.InputStream;
   import java.util.*;
   
   /**
  @@ -101,7 +103,13 @@
               throw new Exception("SourceTypeAction: src attribute should be defined and
non-empty.");
           Source source = sourceResolver.resolveURI(src);
           XMLPullParser parser = new Xerces2();
  -        parser.setInputSource(new XMLInputSource(null, src, null, source.getInputStream(),
null));
  +        try {
  +          InputStream is = source.getInputStream();
  +          parser.setInputSource(new XMLInputSource(null, src, null, is, null));
  +        } catch (SourceNotFoundException e) {
  +          getLogger().warn("Source '"+source+"' not found");
  +          return null;
  +        }
   
           // load nothing external
           parser.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd",
false);
  
  
  

Mime
View raw message