diff options
| author | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-20 05:34:29 +0000 |
|---|---|---|
| committer | mkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-04-20 05:34:29 +0000 |
| commit | b515669fbbf60e9e911ea232570bacc1a07ecdae (patch) | |
| tree | 6ea2243a88838c45ae0e9d00fbb4feac1cc6f054 | |
| parent | 87121034113f8b3bb96db325d3260d806f4e103a (diff) | |
| download | ppe42-gcc-b515669fbbf60e9e911ea232570bacc1a07ecdae.tar.gz ppe42-gcc-b515669fbbf60e9e911ea232570bacc1a07ecdae.zip | |
2005-04-20 Andrew John Hughes <gnu_andrew@member.fsf.org>
* java/net/URL.java:
(toURI()): Implemented.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98437 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | libjava/ChangeLog | 5 | ||||
| -rw-r--r-- | libjava/java/net/URL.java | 17 |
2 files changed, 22 insertions, 0 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 5c5ca3f486e..109791be76c 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2005-04-20 Andrew John Hughes <gnu_andrew@member.fsf.org> + + * java/net/URL.java: + (toURI()): Implemented. + 2005-04-19 Michael Koch <konqueror@gmx.de> * java/net/InetAddress.java diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java index ec86766ba37..7eb68cb3f07 100644 --- a/libjava/java/net/URL.java +++ b/libjava/java/net/URL.java @@ -953,4 +953,21 @@ public final class URL implements Serializable { oos.defaultWriteObject(); } + + /** + * Returns the equivalent <code>URI</code> object for this <code>URL</code>. + * This is the same as calling <code>new URI(this.toString())</code>. + * RFC2396-compliant URLs are guaranteed a successful conversion to + * a <code>URI</code> instance. However, there are some values which + * form valid URLs, but which do not also form RFC2396-compliant URIs. + * + * @throws URISyntaxException if this URL is not RFC2396-compliant, + * and thus can not be successfully converted to a URI. + */ + public URI toURI() + throws URISyntaxException + { + return new URI(toString()); + } + } |

