Revision: 7737
Author: victormote
Date: 2006-06-24 09:11:37 -0700 (Sat, 24 Jun 2006)
ViewCVS: http://svn.sourceforge.net/foray/?rev=7737&view=rev
Log Message:
-----------
Return null instead of throwing a checked exception for invalid input.
Modified Paths:
--------------
trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java
Modified: trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java
===================================================================
--- trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java 2006-06-24 15:56:43 UTC (rev 7736)
+++ trunk/foray/foray-common/src/java/org/foray/common/url/FOrayURLStreamHandlerFactory.java 2006-06-24 16:11:37 UTC (rev 7737)
@@ -77,24 +77,20 @@
/**
* Registers a new {@link URLStreamHandler} for use with a protocol.
* @param protocol The protocol to be registered.
+ * The registration will fail silently if this parameter is null.
* @param handler The {@link URLStreamHandler} instance which should be
* used for URLs whose protocol is <code>protocol</code>.
- * @throws IOException For any of the following reasons:
- * <ul>
- * <li>If <code>protocol</code> or <code>handlerClass</code> are
- * null.</li>
- * <li>If <code>protocol</code> has already been registered</li>
- * </ul>
+ * The registration will fail silently if this parameter is null.
+ * @throws IOException If <code>protocol</code> has already been
+ * registered.
*/
public void registerProtocol(String protocol, URLStreamHandler handler)
throws IOException {
if (protocol == null) {
- throw new IOException("Cannot register a null "
- + "protocol.");
+ return;
}
if (handler == null) {
- throw new IOException("Cannot register a null "
- + "URLStreamHandler.");
+ return;
}
if (this.protocols.containsKey(protocol)) {
throw new IOException("Protocol \n" + protocol
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|