1 23 24 package com.sun.enterprise.instance; 25 26 import com.sun.enterprise.util.StringUtils; 28 import com.sun.enterprise.util.diagnostics.Reminder; 29 import com.sun.enterprise.deployment.backend.DeployableObjectType; 30 31 37 38 public class ModuleEnvironment { 39 private String mModuleName = null; 42 private String mModulePath = null; 43 private String mModuleBackupPath = null; 44 private String mModuleGeneratedXMLPath = null; 45 private String mJavaWebStartPath = null; 46 private String mModuleStubPath = null; 47 private String mModuleJSPPath = null; 48 private InstanceEnvironment mInstance = null; 49 private DeployableObjectType mType = null; 50 78 88 89 public ModuleEnvironment (InstanceEnvironment instance, String moduleName, 90 DeployableObjectType type) { 91 if (instance == null || moduleName == null) { 92 throw new IllegalArgumentException (); 93 } 94 95 if(type == null) { throw new IllegalArgumentException (Localizer.getValue(ExceptionType.NULL_MODULE_TYPE)); 97 } 98 99 mType = type; 100 mInstance = instance; 101 mModuleName = moduleName; 102 createModulePath(); 103 createModuleBackupPath(); 104 createModuleStubPath(); 105 createModuleJSPPath(); 106 createModuleGeneratedXMLPath(); 107 createJavaWebStartPath(); 108 } 109 110 private void createModulePath() { 111 String moduleRepositoryDirPath = mInstance.getModuleRepositoryPath (); 112 String [] onlyFolderNames = new String [] { 113 moduleRepositoryDirPath, 114 mModuleName 115 }; 116 mModulePath = StringUtils.makeFilePath (onlyFolderNames, false); 117 } 118 119 123 124 public String getModulePath() { 125 return mModulePath; 126 } 127 128 132 133 public void createModuleGeneratedXMLPath() { 134 String [] onlyFolderNames = new String [] { 135 mInstance.getModuleGeneratedXMLPath(), 136 mModuleName 137 }; 138 139 mModuleGeneratedXMLPath = StringUtils.makeFilePath (onlyFolderNames, false); 140 } 141 142 146 147 public String getModuleGeneratedXMLPath() { 148 return mModuleGeneratedXMLPath; 149 } 150 151 152 155 156 private void createJavaWebStartPath() { 157 String [] onlyFolderNames = new String [] { 158 mInstance.getJavaWebStartPath(), 159 mModuleName 160 }; 161 162 mJavaWebStartPath = StringUtils.makeFilePath (onlyFolderNames, false); 163 } 164 165 169 170 public String getJavaWebStartPath() { 171 return mJavaWebStartPath; 172 } 173 174 178 179 public void createModuleStubPath() { 180 String [] onlyFolderNames = new String [] { 181 mInstance.getModuleStubPath(), 182 mModuleName 183 }; 184 185 mModuleStubPath = StringUtils.makeFilePath (onlyFolderNames, false); 186 } 187 191 192 public String getModuleStubPath() { 193 return mModuleStubPath; 194 } 195 196 197 198 202 203 public void createModuleJSPPath() { 204 String [] onlyFolderNames = new String [] { 205 mInstance.getWebModuleCompileJspPath(), 206 mModuleName 207 }; 208 209 mModuleJSPPath = StringUtils.makeFilePath (onlyFolderNames, false); 210 } 211 214 215 public String getModuleJSPPath() { 216 return mModuleJSPPath; 217 } 218 219 223 224 public String getModuleBackupPath() { 225 return mModuleBackupPath; 226 } 227 231 232 public void createModuleBackupPath() { 233 String [] onlyFolderNames = new String [] { 234 mInstance.getModuleBackupRepositoryPath(), 235 mModuleName 236 }; 237 238 mModuleBackupPath = StringUtils.makeFilePath (onlyFolderNames, false); 239 } 240 241 242 246 public String verify() 247 { 248 return null; 249 } 250 } 251 | Popular Tags |