Title: [919] trunk/core/src/main/java/org/servicemix/jbi/container/EnvironmentContext.java: SM-114: Fix applied
- Revision
- 919
- Author
- gastaldi
- Date
- 2005-11-23 17:52:44 -0500 (Wed, 23 Nov 2005)
Log Message
SM-114: Fix applied
Modified Paths
Diff
Modified: trunk/core/src/main/java/org/servicemix/jbi/container/EnvironmentContext.java (918 => 919)
--- trunk/core/src/main/java/org/servicemix/jbi/container/EnvironmentContext.java 2005-11-23 22:12:57 UTC (rev 918)
+++ trunk/core/src/main/java/org/servicemix/jbi/container/EnvironmentContext.java 2005-11-23 22:52:44 UTC (rev 919)
@@ -156,14 +156,6 @@
public void init(JBIContainer container, String rootDirPath) throws JBIException {
this.container = container;
jbiRootDir = new File(rootDirPath, container.getName());
- if (!jbiRootDir.exists()) {
- log.warn("Directory does not exist: " + jbiRootDir.getAbsolutePath());
- if (!jbiRootDir.mkdir()) {
- throw new JBIException("Directory could not be created: "+jbiRootDir.getAbsolutePath());
- }
- } else if (!jbiRootDir.isDirectory()) {
- throw new JBIException("Not a directory: " + jbiRootDir.getAbsolutePath());
- }
buildDirectoryStructure();
container.getManagementContext().registerSystemService(this, LifeCycleMBean.class);
}
@@ -470,7 +462,15 @@
}
- private void buildDirectoryStructure() {
+ private void buildDirectoryStructure() throws JBIException {
+ if (!jbiRootDir.exists()) {
+ log.warn("Directory does not exist: " + jbiRootDir.getAbsolutePath());
+ if (!jbiRootDir.mkdir()) {
+ throw new JBIException("Directory could not be created: "+jbiRootDir.getAbsolutePath());
+ }
+ } else if (!jbiRootDir.isDirectory()) {
+ throw new JBIException("Not a directory: " + jbiRootDir.getAbsolutePath());
+ }
if (installationDir == null){
installationDir = FileUtil.getDirectoryPath(jbiRootDir, "install");
}
@@ -481,15 +481,13 @@
tmpDir = FileUtil.getDirectoryPath(jbiRootDir, "tmp");
sharedLibDir = FileUtil.getDirectoryPath(jbiRootDir, "sharedlibs");
saLibDir = FileUtil.getDirectoryPath(jbiRootDir,"service-assemblies");
- if (jbiRootDir.exists() && jbiRootDir.isDirectory()){
- //actually create the sub directories
- FileUtil.buildDirectory(installationDir);
- FileUtil.buildDirectory(deploymentDir);
- FileUtil.buildDirectory(componentsDir);
- FileUtil.buildDirectory(tmpDir);
- FileUtil.buildDirectory(sharedLibDir);
- FileUtil.buildDirectory(saLibDir);
- }
+ //actually create the sub directories
+ FileUtil.buildDirectory(installationDir);
+ FileUtil.buildDirectory(deploymentDir);
+ FileUtil.buildDirectory(componentsDir);
+ FileUtil.buildDirectory(tmpDir);
+ FileUtil.buildDirectory(sharedLibDir);
+ FileUtil.buildDirectory(saLibDir);
}
private void scheduleStatsTimer() {