User: d_jencks
  Date: 02/04/13 18:19:53

  Modified:    src/main/org/jboss/deployment EARDeployer.java
  Log:
  Larry Sanderson's patch to enable deploying unpacked directories
  
  Revision  Changes    Path
  1.12      +36 -3     jboss/src/main/org/jboss/deployment/EARDeployer.java
  
  Index: EARDeployer.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/deployment/EARDeployer.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- EARDeployer.java  3 Apr 2002 08:25:18 -0000       1.11
  +++ EARDeployer.java  14 Apr 2002 01:19:53 -0000      1.12
  @@ -47,7 +47,7 @@
    * Enterprise Archive Deployer.
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  - * @version $Revision: 1.11 $
  + * @version $Revision: 1.12 $
    */
   public class EARDeployer
      extends SubDeployerSupport
  @@ -83,7 +83,8 @@
      
      public boolean accepts(DeploymentInfo di) 
      {
  -      return di.url.getFile().endsWith("ear");
  +      String urlStr = di.url.getFile();
  +      return urlStr.endsWith("ear") || urlStr.endsWith("ear/");
      }
      
      
  @@ -98,7 +99,8 @@
            InputStream in = 
di.localCl.getResourceAsStream("META-INF/application.xml");
            XmlFileLoader xfl = new XmlFileLoader();
            Element root = xfl.getDocument(in, 
"META-INF/application.xml").getDocumentElement();
  -         di.metaData = new J2eeApplicationMetaData(root);
  +         J2eeApplicationMetaData metaData = new J2eeApplicationMetaData(root);
  +         di.metaData = metaData;
            in.close();
            
            // resolve the watch
  @@ -118,6 +120,37 @@
                  
               // If directory we watch the xml files
               else di.watch = new URL(di.url, "META-INF/application.xml"); 
  +         }
  +         
  +         // Obtain the sub-deployment list
  +         File parentDir = null;
  +         String urlPrefix = null;
  +         if (di.isDirectory) 
  +         {
  +            parentDir = new File(di.localUrl.getFile());
  +         } 
  +         else
  +         {
  +            urlPrefix = "njar:" + di.localUrl + "^/";
  +         }
  +         for (Iterator iter = metaData.getModules(); iter.hasNext(); )
  +         {
  +            J2eeModuleMetaData mod = (J2eeModuleMetaData)iter.next();
  +            String fileName = mod.getFileName();
  +            if (fileName != null && (fileName = fileName.trim()).length() > 0)
  +            {
  +               if (di.isDirectory)
  +               {
  +                  File f = new File(parentDir, fileName);
  +                  DeploymentInfo sub = new DeploymentInfo(f.toURL(), di);
  +                  log.debug("Deployment Info: " + sub + ", isDirectory: " + 
sub.isDirectory);
  +               }
  +               else
  +               {
  +                  DeploymentInfo sub = new DeploymentInfo(new URL(urlPrefix + 
fileName), di);
  +                  log.debug("Deployment Info: " + sub + ", isDirectory: " + 
sub.isDirectory);
  +               }
  +            }
            }
         }
         catch (Exception e)
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to