public File getDirectory(final String path) throws IOException { return getDirectory(path, false); }
public File getFile(final String path) throws IOException { return getFile(path, true); }
private SystemInstance(Properties properties) throws Exception { this.components = new HashMap<Class, Object>(); this.internalProperties.putAll(System.getProperties()); this.internalProperties.putAll(properties); this.options = new Options(internalProperties, new Options(System.getProperties())); this.home = new FileUtils("openejb.home", "user.dir", this.internalProperties); this.base = new FileUtils("openejb.base", "openejb.home", this.internalProperties); this.classPath = ClassPathFactory.createClassPath(this.internalProperties.getProperty("openejb.loader", "context")); this.classLoader = classPath.getClassLoader(); this.internalProperties.setProperty("openejb.home", home.getDirectory().getCanonicalPath()); this.internalProperties.setProperty("openejb.base", base.getDirectory().getCanonicalPath()); System.setProperty("derby.system.home", base.getDirectory().getCanonicalPath()); // set the magic system property that causes derby to use explicity // file sync instead of relying on vm support for file open rws System.setProperty("derby.storage.fileSyncTransactionLog", "true"); }
file = SystemInstance.get().getBase().getFile(path); if (file != null && file.exists() && file.isFile()) { return file.getAbsolutePath(); file = SystemInstance.get().getHome().getFile(path); if (file != null && file.exists() && file.isFile()) { return file.getAbsolutePath(); file = SystemInstance.get().getBase().getFile("conf/openejb.xml"); if (file != null && file.exists() && file.isFile()) { return file.getAbsolutePath(); file = SystemInstance.get().getBase().getFile("conf/openejb.conf"); if (file != null && file.exists() && file.isFile()) { return file.getAbsolutePath(); File confDir = SystemInstance.get().getBase().getDirectory("conf", false);
public FileUtils getBase() { if (!isInitialized()) { return new FileUtils("openejb.base", "openejb.home", System.getProperties()); } return base; }
public static File createTempDirectory() throws java.io.IOException { String prefix = System.getProperty("java.io.tmpdir", File.separator + "tmp") + File.separator + "openejb"; return createTempDirectory(prefix); }
final File additionalDeploymentFile = SystemInstance.get().getBase().getFile(ADDITIONAL_DEPLOYMENTS, false); declaredAppsUrls.add(Files.path(base.getDirectory().getAbsoluteFile(), additionalDep.getFile())); } else if (additionalDep.getDir() != null) { declaredAppsUrls.add(Files.path(base.getDirectory().getAbsoluteFile(), additionalDep.getDir()));
public FileUtils getBase() { if (!isInitialized()) { return new FileUtils("openejb.base", "openejb.home", System.getProperties()); } return base; }
public static File createTempDirectory() throws IOException { final String prefix = System.getProperty("java.io.tmpdir", File.separator + "tmp") + File.separator + "openejb"; return createTempDirectory(prefix); }
public File getDirectory(final String path) throws IOException { return getDirectory(path, false); }
final File additionalDeploymentFile = SystemInstance.get().getBase().getFile(ADDITIONAL_DEPLOYMENTS, false); declaredAppsUrls.add(Files.path(base.getDirectory().getAbsoluteFile(), additionalDep.getFile())); } else if (additionalDep.getDir() != null) { declaredAppsUrls.add(Files.path(base.getDirectory().getAbsoluteFile(), additionalDep.getDir()));
this.home = new FileUtils("openejb.home", "user.dir", this.internalProperties); this.base = new FileUtils("openejb.base", "openejb.home", this.internalProperties); this.classPath = ClassPathFactory.createClassPath(this.internalProperties.getProperty("openejb.loader", "context")); this.classLoader = classPath.getClassLoader(); this.internalProperties.setProperty("openejb.home", home.getDirectory().getCanonicalPath()); this.internalProperties.setProperty("openejb.base", base.getDirectory().getCanonicalPath()); System.setProperty("derby.system.home", System.getProperty("derby.system.home", base.getDirectory().getCanonicalPath()));
public File getFile(String path) throws java.io.FileNotFoundException, java.io.IOException { return getFile(path, true); }
public FileUtils getHome() { if (!isInitialized()) { return new FileUtils("openejb.home", "user.dir", System.getProperties()); } return home; }
public static File createTempDirectory() throws IOException { final String prefix = System.getProperty("java.io.tmpdir", File.separator + "tmp") + File.separator + "openejb"; return createTempDirectory(prefix); }
public File getDirectory(String path) throws IOException { return getDirectory(path, false); }
this.home = new FileUtils("openejb.home", "user.dir", this.internalProperties); this.base = new FileUtils("openejb.base", "openejb.home", this.internalProperties); this.classPath = ClassPathFactory.createClassPath(this.internalProperties.getProperty("openejb.loader", "context")); this.classLoader = classPath.getClassLoader(); final String baseDirCanonicalPath; try { homeDirCanonicalPath = home.getDirectory().getCanonicalPath(); baseDirCanonicalPath = base.getDirectory().getCanonicalPath(); } catch (final IOException e) { throw new LoaderRuntimeException("Failed to create default instance of SystemInstance", e);
public File getFile(final String path) throws IOException { return getFile(path, true); }
public FileUtils getHome() { if (!isInitialized()) { return new FileUtils("openejb.home", "user.dir", System.getProperties()); } return home; }
@Override public boolean equals(final Object obj) { if (!(obj instanceof FileUtils)) { return false; } final FileUtils that = (FileUtils) obj; return this.getDirectory().equals(that.getDirectory()); }