[jboss-cvs] JBossAS SVN: r93679 - in projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol: vfs and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Sep 18 07:13:33 EDT 2009


Author: alesj
Date: 2009-09-18 07:13:33 -0400 (Fri, 18 Sep 2009)
New Revision: 93679

Added:
   projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/HostlessHandler.java
Modified:
   projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/vfs/Handler.java
   projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/vfsmemory/Handler.java
Log:
[JBCL-120, JBCL-50]; override the DNS-resolving behavior of hashCode() and equals().

Copied: projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/HostlessHandler.java (from rev 93483, projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/AbstractVFSHandler.java)
===================================================================
--- projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/HostlessHandler.java	                        (rev 0)
+++ projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/HostlessHandler.java	2009-09-18 11:13:33 UTC (rev 93679)
@@ -0,0 +1,42 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.virtual.protocol;
+
+import java.net.InetAddress;
+import java.net.URL;
+import java.net.URLStreamHandler;
+
+/**
+ * Ignore host address.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class HostlessHandler extends URLStreamHandler
+{
+   /**
+    * Always returns null since impl's URLs do not refer to real hosts.
+    */
+   protected InetAddress getHostAddress(URL u)
+   {
+      return null;
+   }
+}
\ No newline at end of file

Modified: projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/vfs/Handler.java
===================================================================
--- projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/vfs/Handler.java	2009-09-18 11:12:22 UTC (rev 93678)
+++ projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/vfs/Handler.java	2009-09-18 11:13:33 UTC (rev 93679)
@@ -24,20 +24,21 @@
 import java.io.IOException;
 import java.net.URL;
 import java.net.URLConnection;
-import java.net.URLStreamHandler;
 
+import org.jboss.virtual.AssembledDirectory;
 import org.jboss.virtual.VirtualFile;
 import org.jboss.virtual.plugins.context.vfs.AssembledContextFactory;
-import org.jboss.virtual.AssembledDirectory;
 import org.jboss.virtual.plugins.vfs.VirtualFileURLConnection;
+import org.jboss.virtual.protocol.HostlessHandler;
 
 /**
  * URLStreamHandler for VFS
  *
  * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
  * @version $Revision: 1.1 $
  */
-public class Handler extends URLStreamHandler
+public class Handler extends HostlessHandler
 {
    protected URLConnection openConnection(URL url) throws IOException
    {

Modified: projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/vfsmemory/Handler.java
===================================================================
--- projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/vfsmemory/Handler.java	2009-09-18 11:12:22 UTC (rev 93678)
+++ projects/vfs/branches/Branch_2_1/src/main/java/org/jboss/virtual/protocol/vfsmemory/Handler.java	2009-09-18 11:13:33 UTC (rev 93679)
@@ -22,15 +22,14 @@
 package org.jboss.virtual.protocol.vfsmemory;
 
 import java.io.IOException;
-import java.net.InetAddress;
 import java.net.URL;
 import java.net.URLConnection;
-import java.net.URLStreamHandler;
 
 import org.jboss.virtual.MemoryFileFactory;
 import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
 import org.jboss.virtual.plugins.vfs.VirtualFileURLConnection;
+import org.jboss.virtual.protocol.HostlessHandler;
 
 /**
  * URLStreamHandler for VFS
@@ -39,7 +38,7 @@
  * @author <a href="ales.justin at jboss.com">Ales Justin</a>
  * @version $Revision: 1.1 $
  */
-public class Handler extends URLStreamHandler
+public class Handler extends HostlessHandler
 {
    protected URLConnection openConnection(URL url) throws IOException
    {
@@ -54,12 +53,4 @@
 
       return new VirtualFileURLConnection(url, vf);
    }
-
-   /**
-    * Always returns null since vfsmemory URLs do not refer to real hosts.
-    */
-   protected InetAddress getHostAddress(URL u)
-   {
-      return null;
-   }
 }




More information about the jboss-cvs-commits mailing list