vgritsenko 2002/08/01 17:24:44 Modified: src/java/org/apache/cocoon/components/source FileSource.java URLSource.java Log: Fix bug #10833 Revision Changes Path 1.4 +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.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- FileSource.java 7 May 2002 08:44:35 -0000 1.3 +++ FileSource.java 2 Aug 2002 00:24:44 -0000 1.4 @@ -57,9 +57,11 @@ import org.apache.avalon.framework.component.ComponentManager; 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.21 +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.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- URLSource.java 4 Jul 2002 15:48:20 -0000 1.20 +++ URLSource.java 2 Aug 2002 00:24:44 -0000 1.21 @@ -201,7 +201,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())); @@ -264,7 +264,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]