[jboss-cvs] JBossAS SVN: r84192 - branches/Branch_5_0/server/src/main/org/jboss/web/deployers.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Feb 13 16:41:51 EST 2009


Author: alesj
Date: 2009-02-13 16:41:50 -0500 (Fri, 13 Feb 2009)
New Revision: 84192

Modified:
   branches/Branch_5_0/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java
Log:
Use vfs to delete the temp war file.

Modified: branches/Branch_5_0/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java
===================================================================
--- branches/Branch_5_0/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java	2009-02-13 17:07:25 UTC (rev 84191)
+++ branches/Branch_5_0/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java	2009-02-13 21:41:50 UTC (rev 84192)
@@ -22,7 +22,6 @@
 package org.jboss.web.deployers;
 
 import java.io.File;
-import java.io.InputStream;
 import java.lang.reflect.Method;
 import java.net.URL;
 import java.util.ArrayList;
@@ -30,12 +29,10 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
 import org.jboss.beans.metadata.api.annotations.Inject;
-import org.jboss.bootstrap.spi.ServerConfig;
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
 import org.jboss.deployers.spi.deployer.helpers.AttachmentLocator;
@@ -56,11 +53,10 @@
 import org.jboss.system.metadata.ServiceDependencyMetaData;
 import org.jboss.system.metadata.ServiceInjectionValueMetaData;
 import org.jboss.system.metadata.ServiceMetaData;
-import org.jboss.system.server.ServerConfigLocator;
 import org.jboss.util.file.Files;
-import org.jboss.util.file.JarUtils;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VFS;
 import org.jboss.virtual.VFSUtils;
+import org.jboss.virtual.VirtualFile;
 import org.jboss.web.WebApplication;
 
 /** A template pattern class for web container integration into JBoss. This class
@@ -467,8 +463,9 @@
          URL warURL = unit.getAttachment("org.jboss.web.expandedWarURL", URL.class);
          if (warURL != null)
          {
-            File war = new File(warURL.toURI());
-            Files.delete(war);
+            // use vfs to delete - since we created it with vfs
+            VirtualFile file = VFS.getRoot(warURL);
+            file.delete();
          }
       }
       catch (Exception e)
@@ -494,14 +491,12 @@
     */
    public WebApplication getDeployedApp(String warUrl)
    {
-      WebApplication appInfo = (WebApplication)deploymentMap.get(warUrl);
-      return appInfo;
+      return (WebApplication)deploymentMap.get(warUrl);
    }
 
    public WebApplication removeDeployedApp(String warURL)
    {
-      WebApplication appInfo = (WebApplication)deploymentMap.remove(warURL);
-      return appInfo;
+      return (WebApplication)deploymentMap.remove(warURL);
    }
 
    /** Returns the applications deployed by the web container subclasses.
@@ -636,8 +631,7 @@
       // The ctx path value cannot be empty in the object name
       if (ctxPath == null || ctxPath.length() == 0)
          ctxPath = "/";
-      String objectName = "jboss.web.deployment:war=" + virtualHost + ctxPath;
-      return objectName;
+      return "jboss.web.deployment:war=" + virtualHost + ctxPath;
    }
 
    /**




More information about the jboss-cvs-commits mailing list