[jboss-cvs] JBossAS SVN: r57492 - trunk/system/src/main/org/jboss/system/server/profileservice

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sun Oct 8 00:30:20 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-10-08 00:30:19 -0400 (Sun, 08 Oct 2006)
New Revision: 57492

Modified:
   trunk/system/src/main/org/jboss/system/server/profileservice/VFSScanner.java
Log:
Replace the URIFilter with a VirtualFileFilter

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/VFSScanner.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/VFSScanner.java	2006-10-08 04:05:03 UTC (rev 57491)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/VFSScanner.java	2006-10-08 04:30:19 UTC (rev 57492)
@@ -34,8 +34,6 @@
 import java.util.concurrent.CopyOnWriteArrayList;
 
 import org.jboss.deployers.spi.structure.DeploymentContext;
-import org.jboss.net.protocol.URLLister;
-import org.jboss.net.protocol.URLLister.URLFilter;
 import org.jboss.profileservice.spi.Profile;
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.profileservice.spi.ProfileService;
@@ -43,6 +41,7 @@
 import org.jboss.util.StringPropertyReplacer;
 import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
 
 /**
  * A DeploymentScanner build on top of the VFS and ProfileService. This is a
@@ -71,7 +70,7 @@
    private List<VirtualFile> vdfList = new CopyOnWriteArrayList<VirtualFile>();;
    
    /** Allow a filter for scanned directories */
-   private URLLister.URLFilter filter;   
+   private VirtualFileFilter filter;   
 
    /** Whether to search for files inside directories whose names containing no dots */
    private boolean doRecursiveSearch = true;
@@ -209,9 +208,9 @@
    }
 
    /**
-    * Set the filer
+    * Set the filter
     * 
-    * @param classname the filer class name
+    * @param classname the filter class name
     * @throws ClassNotFoundException when the class is not found
     * @throws IllegalAccessException when the class's default constructor is not public
     * @throws InstantiationException when there is an error constructing the class
@@ -219,8 +218,9 @@
    public void setFilter(String classname)
       throws ClassNotFoundException, IllegalAccessException, InstantiationException
    {
-      Class filterClass = Thread.currentThread().getContextClassLoader().loadClass(classname);
-      filter = (URLLister.URLFilter)filterClass.newInstance();
+      ClassLoader loader = Thread.currentThread().getContextClassLoader();
+      Class<VirtualFileFilter> filterClass = (Class<VirtualFileFilter>) loader.loadClass(classname);
+      filter = filterClass.newInstance();
    }
 
    /**
@@ -242,7 +242,7 @@
     * 
     * @param filter ther filter
     */
-   public void setFilterInstance(URLFilter filter)
+   public void setFilterInstance(VirtualFileFilter filter)
    {
       this.filter = filter;
    }
@@ -252,7 +252,7 @@
     * 
     * @return the filter
     */
-   public URLFilter getFilterInstance()
+   public VirtualFileFilter getFilterInstance()
    {
       return filter;
    }
@@ -529,8 +529,7 @@
       {
          if (component.isLeaf())
          {
-            // the first arg in filter.accept is not used!
-            if (filter == null || filter.accept(null, component.getName()))
+            if (filter == null || filter.accepts(component))
             {
                list.add(component);
             }            




More information about the jboss-cvs-commits mailing list