1 23 package com.sun.enterprise.deployment; 24 25 import com.sun.enterprise.deployment.deploy.shared.AbstractArchive; 26 import com.sun.enterprise.util.Utility; 27 import com.sun.logging.*; 28 29 import java.io.*; 30 import java.util.logging.*; 31 32 39 public class DeploymentContext extends java.lang.Object { 40 41 44 private Application application; 45 46 49 private AbstractArchive archive=null; 50 51 54 private File appTmpDir=null; 55 56 57 static Logger _logger = LogDomains.getLogger(LogDomains.DPL_LOGGER); 58 59 64 public DeploymentContext(AbstractArchive archive, Application application) { 65 this.application = application; 66 this.archive = archive; 67 } 68 69 72 public Application getApplication() { 73 return application; 74 } 75 76 80 public AbstractArchive getArchive() { 81 return archive; 82 } 83 84 88 public File getOutputDirectory() { 89 return new File(archive.getArchiveUri()); 90 } 91 92 96 public File getSourceDirectory() { 97 return new File(archive.getArchiveUri()); 98 } 99 100 104 public ClassLoader getClassLoader() { 105 return application.getClassLoader(); 106 } 107 108 111 public static void deleteDirectory(File dir) { 112 File[] files = dir.listFiles(); 113 if (files != null) { 114 for(int i=0; i < files.length; ++i) { 115 File child = files[i]; 116 if(child.isDirectory()) { 117 deleteDirectory(child); 118 } 119 child.delete(); 120 } 121 } 122 dir.delete(); 123 } 124 125 } 126 | Popular Tags |