This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: gnu.java.net.protocol.file.Handler


On Monday 13 September 2004 19:04, Bryce McKinlay wrote:

> OK, so the only thing this patch changes is to remove a redundant
> check from file.Handler.openConnection() ?

Yes.

> If so, the comment seems unclear to me. Wouldn't it be better to
> say something like "If the ftp protocol handler is not installed,
> an exception will be thrown from the new openConnection() call.".
> Also, we should assume that ftp will be supported at some point and
> not explicity say it isn't here.
>
> Otherwise the patch is OK, thanks.

Ok. I commited the attached patch now.


Michael
Index: gnu/java/net/protocol/file/Handler.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/net/protocol/file/Handler.java,v
retrieving revision 1.3
diff -u -r1.3 Handler.java
--- gnu/java/net/protocol/file/Handler.java	26 Nov 2003 10:17:51 -0000	1.3
+++ gnu/java/net/protocol/file/Handler.java	15 Sep 2004 12:36:14 -0000
@@ -1,5 +1,5 @@
 /* Handler.java -- "file" protocol handler for java.net
-   Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -76,17 +76,14 @@
     String host = url.getHost();
     if ((host != null) && (! host.equals("")))
       {
-        throw new IOException("ftp protocol handler not yet implemented.");
-        /*
 	// Reset the protocol (and implicitly the handler) for this URL.
 	// Then have the URL attempt the connection again, as it will
 	// get the changed handler the next time around.
+	// If the ftp protocol handler is not installed, an 
+	// exception will be thrown from the new openConnection() call.
 	setURL (url, "ftp", url.getHost(), url.getPort(), url.getFile(),
-		url.getRef());
-	// Until the ftp protocol handler is written, this will cause
-	// a NullPointerException.
+	        url.getRef());
 	return url.openConnection();
-	*/
       }
 
     return new Connection(url);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]