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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 23 08:16:29 EST 2009


Author: emuckenhuber
Date: 2009-02-23 08:16:29 -0500 (Mon, 23 Feb 2009)
New Revision: 84620

Modified:
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/FilteredDeploymentRepositoryFactory.java
Log:
update resolving deployment names

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/FilteredDeploymentRepositoryFactory.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/FilteredDeploymentRepositoryFactory.java	2009-02-23 13:09:50 UTC (rev 84619)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/FilteredDeploymentRepositoryFactory.java	2009-02-23 13:16:29 UTC (rev 84620)
@@ -21,6 +21,7 @@
  */ 
 package org.jboss.system.server.profileservice.repository;
 
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URI;
@@ -117,9 +118,9 @@
          for(String deploymentName : deploymentNames)
          {
             // Get the deployment content
-            VirtualFile vf = getDeploymentContent(deploymentName);
+            VirtualFile vf = resolveDeploymentName(deploymentName);
             // Load the deployment
-            ProfileDeployment deployment = loadDeploymentData(vf);
+            ProfileDeployment deployment = createDeployment(vf);
             // Add the deployment
             addDeployment(deployment.getName(), deployment);
          }
@@ -141,5 +142,26 @@
       {
          // nothing
       }
+      
+      protected VirtualFile resolveDeploymentName(String deploymentName) throws IOException
+      {
+         List<VirtualFile> list = new ArrayList<VirtualFile>();
+         for(URI uri : getRepositoryURIs())
+         {
+            VirtualFile repo = getCachedVirtualFile(uri);
+            VirtualFile vf = repo.getChild(deploymentName);
+            if(vf != null)
+               list.add(vf);
+         }
+         if(list.size() == 0)
+         {
+            throw new FileNotFoundException("Unable to find name: " + deploymentName);
+         }
+         else if (list.size() > 1)
+         {
+            throw new FileNotFoundException("Multiple matching names: " + deploymentName + " available " + list);
+         }
+         return list.get(0);
+      }
    }   
 }




More information about the jboss-cvs-commits mailing list