[jboss-cvs] JBossAS SVN: r86291 - branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Mar 25 05:06:11 EDT 2009


Author: emuckenhuber
Date: 2009-03-25 05:06:11 -0400 (Wed, 25 Mar 2009)
New Revision: 86291

Modified:
   branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java
Log:
add a recursive scan flag.

Modified: branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java	2009-03-25 07:47:14 UTC (rev 86290)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java	2009-03-25 09:06:11 UTC (rev 86291)
@@ -60,6 +60,9 @@
    
    /** The application files keyed by VirtualFile URI string. */
    private final Map<String, VirtualFile> applicationVFCache = new ConcurrentHashMap<String, VirtualFile>();
+   
+   /** Do a recursive search - default == true. */
+   private boolean recursiveScan = true;
 
    /** The last time the profile was modified. */
    private volatile long lastModified;
@@ -89,6 +92,16 @@
       this.deploymentFilter = deploymentFilter;
    }
    
+   public boolean isRecursiveScan()
+   {
+      return recursiveScan;
+   }
+   
+   public void setRecursiveScan(boolean recursiveScan)
+   {
+      this.recursiveScan = recursiveScan;
+   }
+   
    public URI[] getRepositoryURIs()
    {
       return uris.toArray(new URI[uris.size()]);
@@ -200,19 +213,24 @@
       if(acceptsDeployment(key) == false)
          return;
 
-      if (component.isLeaf())
+      // If it's a directory or exploded deployment
+      if(component.isLeaf() == false && component.isArchive() == false)
       {
-         list.add(component);
+         // Check the name
+         if(isRecursiveScan() && component.getName().indexOf('.') == -1)
+         {
+            // recurse if not '.' in name and recursive search is enabled
+            addedDeployments(list, component);            
+         }
+         else
+         {
+            list.add(component);
+         }
       }
-      else if (component.getName().indexOf('.') == -1)
-      {
-         // recurse if not '.' in name and recursive search is enabled
-         addedDeployments(list, component);
-      }
       else
       {
          list.add(component);
-      }      
+      }
    }
    
    protected boolean acceptsDeployment(String name)




More information about the jboss-cvs-commits mailing list