This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: gnu.java.net.protocol.file.Handler
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Fri, 10 Sep 2004 15:04:07 +0200
- Subject: Patch: gnu.java.net.protocol.file.Handler
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi list,
I megred the attached patch from classpath.
Okay to commit to trunk ?
Michael
2004-09-10 Michael Koch <konqueror@gmx.de>
* gnu/java/net/protocol/file/Handler.java
(openConnection): Don't throw exception if host part for file: URI is
present. setURL() keeps file: protocol if ftp: protocol is not
available.
- --
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFBQaZKWSOgCCdjSDsRAusGAJwL8nHPOREph3kntvyt+XlD9Iz80QCeOzpw
bT0hbNZezWnrw6XL1fD+JjU=
=I3FP
-----END PGP SIGNATURE-----
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 10 Sep 2004 12:55:43 -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,15 @@
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.
+ // N.B.: FTP protocol is not supported by default in GNU Classpath
+ // but it does not matter because setURL will keep the current protocol
+ // if "ftp" is not available.
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);