excalibur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Simons (JIRA)" <...@excalibur.apache.org>
Subject [jira] Commented: (EXLBR-19) URLSource reports non-existent URL exists
Date Sun, 24 Apr 2005 21:52:24 GMT
     [ http://issues.apache.org/jira/browse/EXLBR-19?page=comments#action_63617 ]
Leo Simons commented on EXLBR-19:

I just took a look at this code for the first time. It's kinda wrong in some key areas.

In this case HTTP existence is indicated using response codes. See


for how to get at them. A check for a 200 or 303 or 304 (depending on what "exists" is supposed
to mean) makes sense for HTTP. For stuff like FTP, getting content length may not be a good
idea as it might mean fetching the file. "exists" is not something that "in general" can be
associated with URLs, so it might have made sense to have some kind of "featureset" detection
with supportExistsCheck() returning false for URL types where existence is unknown, rather
than "hacking on" functionality like this. Using commons-httpclient might also make sense.

I believe the source resolver is an important part of cocoon so someone might want to investigate
fixing this "properly".

> URLSource reports non-existent URL exists
> -----------------------------------------
>          Key: EXLBR-19
>          URL: http://issues.apache.org/jira/browse/EXLBR-19
>      Project: Excalibur Components
>         Type: Bug
>   Components: SourceResolver
>     Versions: 1.1
>  Environment: Using Cocoon 2.1.X under Tomcat 5.0.30-beta and Jetty 5.1.0 on Windows
XP and W2K servers
>     Reporter: Paul Christmann
>     Assignee: Shash Chatterjee
>  Attachments: URLSourceTestCase.java, patchfile.txt
> The URLSource exists() method incorrectly returns "true" even if the provided URL (via
the init method) does not exist.
>     URLSource source = new URLSource();
>     source.init("http://www.nosuchsite.com", Collections.EMPTY_MAP);
>     if ( source.exists() ) {
>         // It shouldn't, but exists returns true
>     }

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

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

View raw message