Revision: 7762
Author: victormote
Date: 2006-07-07 19:07:37 -0700 (Fri, 07 Jul 2006)
ViewCVS: http://svn.sourceforge.net/foray/?rev=7762&view=rev
Log Message:
-----------
Convert into a ProtocolRegistrationStrategy implementation.
Modified Paths:
--------------
trunk/foray/foray-common/src/java/org/foray/common/url/UniversalProtocolRegistration.java
Modified: trunk/foray/foray-common/src/java/org/foray/common/url/UniversalProtocolRegistration.java
===================================================================
--- trunk/foray/foray-common/src/java/org/foray/common/url/UniversalProtocolRegistration.java 2006-07-08 01:58:47 UTC (rev 7761)
+++ trunk/foray/foray-common/src/java/org/foray/common/url/UniversalProtocolRegistration.java 2006-07-08 02:07:37 UTC (rev 7762)
@@ -20,7 +20,9 @@
*
*/
-/* $Id$ */
+/*
+$Id$
+*/
/* Known contributors:
* Vincent Hennebert (original author)
@@ -30,30 +32,22 @@
import java.net.URLStreamHandler;
+import java.net.URLStreamHandlerFactory;
/**
- * Abstract superclass for all URLStreamHandlers using the FOray scheme for
- * custom URLStreamHandler registration.
+ * Registers URL protocols in a universal manner, attempting first to register
+ * using a {@link URLStreamHandlerFactory}, then using the Java properties
+ * method as a fallback.
+ * @see PropertyProtocolRegistration which registers only using the Java
+ * properties method.
*/
-public abstract class UniversalProtocolRegistration extends URLStreamHandler {
+public class UniversalProtocolRegistration
+ extends AbstractProtocolRegistration {
/**
- * Register an instance of this class with the custom
- * URLStreamHandlerFactory so that this handler will be used for URLs of
- * a specific type.
- * @param protocol The name of the protocol to register.
- * @param handler The handler that should be registered to handle URLs of
- * type <code>protocol</code>.
+ * {@inheritDoc}
*/
- protected static void register(String protocol, URLStreamHandler handler) {
- /* Validate the input. */
- if (protocol == null) {
- return;
- }
- if (handler == null) {
- return;
- }
-
+ public void doRegister(String protocol, URLStreamHandler handler) {
/* Get the Factory instance. */
FOrayURLStreamHandlerFactory factory =
FOrayURLStreamHandlerFactory.getURLStreamHandlerFactory();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|