[jboss-cvs] JBossAS SVN: r84193 - trunk/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:50:35 EST 2009
Author: alesj
Date: 2009-02-13 16:50:35 -0500 (Fri, 13 Feb 2009)
New Revision: 84193
Modified:
trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java
Log:
Use vfs to cleanup.
Modified: trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java 2009-02-13 21:41:50 UTC (rev 84192)
+++ trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java 2009-02-13 21:50:35 UTC (rev 84193)
@@ -56,6 +56,7 @@
import org.jboss.util.file.Files;
import org.jboss.virtual.VFSUtils;
import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VFS;
import org.jboss.web.WebApplication;
/** A template pattern class for web container integration into JBoss. This class
@@ -462,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 cleanup/delete - since we created it with vfs
+ VirtualFile file = VFS.getRoot(warURL);
+ file.cleanup(); // it's temp, it will be deleted as well
}
}
catch (Exception e)
@@ -489,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.
@@ -631,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