You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@excalibur.apache.org by sh...@apache.org on 2005/04/16 16:51:43 UTC

svn commit: r161575 - excalibur/trunk/components/sourceresolve/src/java/org/apache/excalibur/source/impl/URLSource.java

Author: shash
Date: Sat Apr 16 07:51:43 2005
New Revision: 161575

URL: http://svn.apache.org/viewcvs?view=rev&rev=161575
Log:
Patch from: http://issues.apache.org/jira/browse/EXLBR-19
Fixes:  The URLSource exists() method incorrectly returns "true" even if the provided URL (via the init method) does not exist.

Modified:
    excalibur/trunk/components/sourceresolve/src/java/org/apache/excalibur/source/impl/URLSource.java

Modified: excalibur/trunk/components/sourceresolve/src/java/org/apache/excalibur/source/impl/URLSource.java
URL: http://svn.apache.org/viewcvs/excalibur/trunk/components/sourceresolve/src/java/org/apache/excalibur/source/impl/URLSource.java?view=diff&r1=161574&r2=161575
==============================================================================
--- excalibur/trunk/components/sourceresolve/src/java/org/apache/excalibur/source/impl/URLSource.java (original)
+++ excalibur/trunk/components/sourceresolve/src/java/org/apache/excalibur/source/impl/URLSource.java Sat Apr 16 07:51:43 2005
@@ -162,10 +162,10 @@
                     }
                 }
                 setLastModified(m_connection.getLastModified());
-                setContentLength(m_connection.getContentLength());
                 m_mimeType = m_connection.getContentType();
-                m_exists = true;
-            }
+                int contentLength = m_connection.getContentLength();
+                setContentLength(contentLength);
+                m_exists = contentLength >= 0;            }
             catch (IOException ignore)
             {
                 super.getInfos();



---------------------------------------------------------------------
To unsubscribe, e-mail: scm-unsubscribe@excalibur.apache.org
For additional commands, e-mail: scm-help@excalibur.apache.org