vgritsenko    2002/08/01 17:25:10

  Modified:    src/java/org/apache/cocoon/components/source Tag:
                        cocoon_2_0_3_branch FileSource.java URLSource.java
  Log:
  Fix bug #10833
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +9 -2      
xml-cocoon2/src/java/org/apache/cocoon/components/source/FileSource.java
  
  Index: FileSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/FileSource.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- FileSource.java   28 Feb 2002 18:00:50 -0000      1.2
  +++ FileSource.java   2 Aug 2002 00:25:10 -0000       1.2.2.1
  @@ -58,9 +58,11 @@
   
   import org.apache.cocoon.environment.WriteableSource;
   import org.apache.cocoon.ProcessingException;
  +import org.apache.cocoon.ResourceNotFoundException;
   
   import java.io.File;
   import java.io.FileInputStream;
  +import java.io.FileNotFoundException;
   import java.io.FileOutputStream;
   import java.io.FilterOutputStream;
   import java.io.InputStream;
  @@ -137,7 +139,12 @@
        * Get the input stream for this source.
        */
       public InputStream getInputStream() throws IOException, ProcessingException {
  -        return new FileInputStream(this.file);
  +        try {
  +            return new FileInputStream(this.file);
  +        } catch (FileNotFoundException e) {
  +            throw new ResourceNotFoundException("Resource not found "
  +                                                + this.systemId, e);
  +        }
       }
       
       public long getLastModified() {
  
  
  
  1.13.2.3  +3 -3      
xml-cocoon2/src/java/org/apache/cocoon/components/source/URLSource.java
  
  Index: URLSource.java
  ===================================================================
  RCS file: 
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/URLSource.java,v
  retrieving revision 1.13.2.2
  retrieving revision 1.13.2.3
  diff -u -r1.13.2.2 -r1.13.2.3
  --- URLSource.java    7 Jun 2002 09:34:23 -0000       1.13.2.2
  +++ URLSource.java    2 Aug 2002 00:25:10 -0000       1.13.2.3
  @@ -213,7 +213,7 @@
       public InputStream getInputStream()
       throws IOException, ProcessingException {
           this.getInfos();
  -        try{
  +        try {
               InputStream input = null;
               if ( this.isFile ) {
                   input = new FileInputStream(this.systemId.substring(FILE.length()));
  @@ -276,7 +276,7 @@
                   this.connection = null; // make sure a new connection is created 
next time
               }
               return input;
  -        } catch(FileNotFoundException e) {
  +        } catch (FileNotFoundException e) {
               throw new ResourceNotFoundException("Resource not found "
                                                   + this.systemId, e);
           }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     [EMAIL PROTECTED]
To unsubscribe, e-mail:          [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to