Author: andreas
Date: Mon Jul 14 05:03:30 2008
New Revision: 676561
URL: http://svn.apache.org/viewvc?rev=676561&view=rev
Log:
Throw SourceNotFoundException instead of NPE if SiteSource doesn't exist in getInputStream().
Modified:
lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java
Modified: lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java?rev=676561&r1=676560&r2=676561&view=diff
==============================================================================
--- lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java (original)
+++ lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source/SiteSource.java Mon Jul 14 05:03:30 2008
@@ -138,6 +138,9 @@
}
public InputStream getInputStream() throws IOException, SourceNotFoundException {
+ if (!exists()) {
+ throw new SourceNotFoundException("The source [" + getURI() + "] does not exist!");
+ }
return this.delegate.getInputStream();
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.