[
Lists Home |
Date Index |
Thread Index
]
At 1:58 PM -0500 1/24/02, Norman Walsh wrote:
>| offers exactly the functionality you're looking for:
>|
>| public URL(URL context,
>| String spec)
>| throws MalformedURLException
>
>Uhm. I'm confused. That'll return the stream, but I actually want the
>URI to be passed through *the resolver* (for example XML Catalogs[1])
>not blindly slurped across the net.
>
No, that doesn't create a stream. It just constructs a new URL
object. If you want to get a stream (You don't have to) then you
would call openStream() on the new object.
YOu should also check out the new java.net.URI class in Java 1.4:
http://java.sun.com/j2se/1.4/docs/api/java/net/URI.html
The following methods are particularly interesting:
public URI resolve(URI uri)
public URI resolve(String uri)
These return the absolute form of the uri argument using the current
URI object as the context. Isn't this what you want?
--
+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| The XML Bible, 2nd Edition (Hungry Minds, 2001) |
| http://www.ibiblio.org/xml/books/bible2/ |
| http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/ |
+----------------------------------+---------------------------------+
|