hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Buren Southerland <j...@southerland-consulting.com>
Subject java.net.URL or URI
Date Fri, 10 Mar 2006 22:12:31 GMT
I'm sure their is a perfectly good reason for this, but none the less
the question is nawing at the very depths of my soul.
Why does the constructor to the standard methods not accept java.net.URL
or URI objects?
I just added support in my app for images and such from the returned
text and though how much functionality would be introduced by that
addition.

For instance, i have a top level url "http://www.ibm.com/index.html"
and that page contains, way too many links, all relative of course.
so to get the images my method creations look something like:
Pattern pat = new Pattern(someReallyCoolRegexHere);
Matcher match = pat.matcher(webPageTextHere);
while( match.find() )
    GetMethod get = new GetMethod( new URL( topURL,
match.group(1)).toString() );

but if the url was supported, and extended with some of the simple
features, it would be cleaner:

GetMethod get = new GetMethod( topUrl, match.group(1) );

As I type this I realize it is probably trivial, but surely a reason
must exist that string was supported rather than url?
Thanks, John

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message