aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net/URL.java
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2002-10-05 07:49:08 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2002-10-05 07:49:08 +0000
commitf5b63cb6d7bb6b742d69f428cc80d60a93f45b3a (patch)
treec89d38b0940a603cf77e3e41a1c3da5ff31cd85c /libjava/java/net/URL.java
parentfec836256eb5cd5a1e9e2a7d16f2a19797f9f0fb (diff)
downloadgcc-f5b63cb6d7bb6b742d69f428cc80d60a93f45b3a.zip
gcc-f5b63cb6d7bb6b742d69f428cc80d60a93f45b3a.tar.gz
gcc-f5b63cb6d7bb6b742d69f428cc80d60a93f45b3a.tar.bz2
2002-10-05 Michael Koch <konqueror@gmx.de>
* java/net/InetAddress.java (getByAddress): Fixed documentation. (getByAddress): New method. * java/net/Inet4Address.java: New file. * java/net/URL.java (URL): Documentation added. (getContent): Documentation added. (getContent): New stubbed method. (getQuery): New method. (openConnection): Documentation added. (openStream): Documentation added. (setURLStreamHandlerFactory): Documentation added. * java/net/URI.java: New stub file. * Makefile.am (java_native_source_files): Added java/net/Inet4Address.java, java/net/Inet6Address.java and java/net/URI.java. * Makefile.in: Regenerated. From-SVN: r57841
Diffstat (limited to 'libjava/java/net/URL.java')
-rw-r--r--libjava/java/net/URL.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java
index 226ad6c..d93dbfb 100644
--- a/libjava/java/net/URL.java
+++ b/libjava/java/net/URL.java
@@ -83,6 +83,9 @@ public final class URL implements Serializable
* @param handler The stream handler for the URL
*
* @exception MalformedURLException If an error occurs
+ * @exception SecurityException If a security manager exists and its
+ * checkPermission method doesn't allow specifying a stream handler
+ * explicitly
*
* @since 1.2
*/
@@ -166,6 +169,9 @@ public final class URL implements Serializable
* @param handler The stream handler for the URL
*
* @exception MalformedURLException If an error occurs
+ * @exception SecurityException If a security manager exists and its
+ * checkPermission method doesn't allow specifying a stream handler
+ * explicitly
*
* @since 1.2
*/
@@ -287,6 +293,8 @@ public final class URL implements Serializable
/**
* Gets the contents of this URL
*
+ * @exception IOException If an error occurs
+ *
* @since 1.3
*/
public final Object getContent() throws IOException
@@ -294,6 +302,17 @@ public final class URL implements Serializable
return openConnection().getContent();
}
+ /**
+ * Gets the contents of this URL
+ *
+ * @exception IOException If an error occurs
+ */
+ public final Object getContent (Class[] classes) throws IOException
+ {
+ // FIXME: implement this
+ return getContent();
+ }
+
public String getFile()
{
return file;
@@ -366,6 +385,14 @@ public final class URL implements Serializable
return at < 0 ? null : host.substring(0, at);
}
+ /**
+ * Returns the query of the URL
+ */
+ public String getQuery ()
+ {
+ return query;
+ }
+
public int hashCode()
{
// JCL book says this is computed using (only) the hashcodes of the
@@ -389,11 +416,23 @@ public final class URL implements Serializable
port + file.hashCode());
}
+ /**
+ * Returns a URLConnection object that represents a connection to the remote
+ * object referred to by the URL
+ *
+ * @exception IOException If an error occurs
+ */
public URLConnection openConnection() throws IOException
{
return handler.openConnection(this);
}
+ /**
+ * Opens a connection to this URL and returns an InputStream for reading
+ * from that connection
+ *
+ * @exception IOException If an error occurs
+ */
public final InputStream openStream() throws IOException
{
return openConnection().getInputStream();
@@ -458,6 +497,13 @@ public final class URL implements Serializable
hashCode = hashCode(); // Used for serialization.
}
+ /**
+ * Sets an application's URLStreamHandlerFactory
+ *
+ * @exception Error If the application has already set a factory
+ * @exception SecurityException If a security manager exists and its
+ * checkSetFactory method doesn't allow the operation
+ */
public static synchronized void
setURLStreamHandlerFactory(URLStreamHandlerFactory fac)
{