public File getDirectory(final String path) throws IOException { return getDirectory(path, false); }
@Override public boolean equals(final Object obj) { if (!(obj instanceof FileUtils)) { return false; } final FileUtils that = (FileUtils) obj; return this.getDirectory().equals(that.getDirectory()); }
@Override public boolean equals(final Object obj) { if (!(obj instanceof FileUtils)) { return false; } final FileUtils that = (FileUtils) obj; return this.getDirectory().equals(that.getDirectory()); }
public boolean equals(Object obj) { if (!(obj instanceof FileUtils)) return false; FileUtils that = (FileUtils) obj; return this.getDirectory().equals(that.getDirectory()); }
private void updatePath() { if (path != null && path.startsWith(HOME_VAR)) { path = SystemInstance.get().getHome().getDirectory().getAbsolutePath() + path.substring(HOME_VAR.length()); } }
private void updatePath() { if (path != null && path.startsWith(HOME_VAR)) { path = SystemInstance.get().getHome().getDirectory().getAbsolutePath() + path.substring(HOME_VAR.length()); } }
/** * Reads the system property: tribe.backup.folder.path * This property can set the backups folder location. The location where we are going to store all the backups. * The default value is .../<tag>/backups/ * * @return the full path of the backups folder. */ public static File getBackupsFolder() { final File defaultFolder = new File(SystemInstance.get().getBase().getDirectory(), "backups"); return new File(System.getProperty("tribe.backup.folder.path", defaultFolder.getAbsolutePath())); }
private static URL select(Enumeration<URL> enumeration) { if (enumeration == null) return null; ArrayList<URL> urls = Collections.list(enumeration); if (urls.size() == 0) return null; if (urls.size() == 1) return urls.get(0); // Sort so that the URL closest to openejb.base is first Collections.sort(urls, new UrlComparator(SystemInstance.get().getBase().getDirectory())); return urls.get(0); }
public static File cacheFile(final String path) { final File cacheDir = new File(SystemInstance.get().getBase().getDirectory(), cache()); if (!cacheDir.exists() && !cacheDir.mkdirs()) { throw new RuntimeException("Failed to create the directory: " + cacheDir); } return new File(cacheDir, path); }
public static URL serverRouterConfigurationURL() { final File confDir = SystemInstance.get().getHome().getDirectory(); final File configFile = new File(confDir, "conf/" + routerConfigurationName()); if (configFile.exists()) { try { return configFile.toURI().toURL(); } catch (final MalformedURLException e) { // let return null } } return null; }
public void configure(BasicDataSource dataSource) { System.setProperty("derby.system.home", SystemInstance.get().getBase().getDirectory().getAbsolutePath()); }
public static File cacheFile(final String path) { final String cache = cache(); if (new File(cache).isAbsolute()) { return new File(cache, path); } return new File(SystemInstance.get().getBase().getDirectory(), cache + File.separator + path); }
private static URL select(final Enumeration<URL> enumeration) { if (enumeration == null) { return null; } final ArrayList<URL> urls = Collections.list(enumeration); if (urls.size() == 0) { return null; } if (urls.size() == 1) { return urls.get(0); } // Sort so that the URL closest to openejb.base is first Collections.sort(urls, new UrlComparator(SystemInstance.get().getBase().getDirectory())); return urls.get(0); }
private static URL select(final Enumeration<URL> enumeration) { if (enumeration == null) { return null; } final ArrayList<URL> urls = Collections.list(enumeration); if (urls.size() == 0) { return null; } if (urls.size() == 1) { return urls.get(0); } // Sort so that the URL closest to openejb.base is first Collections.sort(urls, new UrlComparator(SystemInstance.get().getBase().getDirectory())); return urls.get(0); }
File outputDirectory() { final File workDirectory = new File(SystemInstance.get().getBase().getDirectory(), "work"); return Files.mkdirs(new File(System.getProperty("tribe.governance.configuration.dump.directory", workDirectory.getAbsolutePath()))); }
private static File tmpDir() throws IOException { File dir = UrlCache.cacheDir; if (null == dir) { dir = SystemInstance.get().getBase().getDirectory("tmp", true); } return dir; }
@Override public String updatedUrl(final String dataSourceUrl) { System.setProperty("derby.system.home" , SystemInstance.get().getProperty("derby.system.home", SystemInstance.get().getBase().getDirectory().getAbsolutePath())); return dataSourceUrl; }
private static void loadFromFile(final Deployments dep, final FileUtils path, final List<File> jarList) { final File file = Files.path(path.getDirectory(), dep.getFile()); Files.exists(file); Files.readable(file); Files.file(file); if (!jarList.contains(file)) { jarList.add(file); } }
private static void loadFromFile(final Deployments dep, final FileUtils path, final List<File> jarList) { final File file = Files.path(path.getDirectory(), dep.getFile()); Files.exists(file); Files.readable(file); Files.file(file); if (!jarList.contains(file)) { jarList.add(file); } }
@Override public String updatedUrl(final String dataSourceUrl) { JavaSecurityManagers.setSystemProperty("derby.system.home" , SystemInstance.get().getProperty("derby.system.home", SystemInstance.get().getBase().getDirectory().getAbsolutePath())); return dataSourceUrl; }