public File getFile(final String path) throws IOException { return getFile(path, true); }
public File getFile(final String path) throws IOException { return getFile(path, true); }
public File getFile(String path) throws java.io.FileNotFoundException, java.io.IOException { return getFile(path, true); }
public static File fromName(final String filename) { File file = new File(filename); try { if (!file.isAbsolute()) { file = SystemInstance.get().getBase().getFile(filename, false); } } catch (final IOException e) { // shouldn't happen with validate set to false above return file; } return file; }
private File fromName(final String filename) { File file = new File(simpleValue(filename)); try { if (!file.isAbsolute()) { file = SystemInstance.get().getBase().getFile(filename, false); } } catch (final IOException e) { // shouldn't happen with validate set to false above return null; } return file; } }
public boolean isValidated(String jarFile) { try { File jar = SystemInstance.get().getBase().getFile(jarFile); long lastModified = jar.lastModified(); long lastValidated = getLastValidated(jar); return (lastValidated > lastModified); } catch (Exception e) { return false; } }
/** * Takes a raw unparsed string expected to be in jvm classpath syntax * and parses it, producing a collection of URIs representing the absolute * file paths of the classpath to be created. * <p/> * OS specific delimiters are supported. * * @param rawstring unparsed string in "classpath" syntax * @return URI array * @throws IOException if path cannot be resolved or file referenced does not exist */ public static URI[] resolveClasspath(final String rawstring) throws IOException { final FileUtils base = SystemInstance.get().getBase(); final String[] strings = rawstring.contains("mvn:") ? rawstring.split(";") : rawstring.split(File.pathSeparator); final Collection<URI> classpath = new LinkedList<>(); for (final String string : strings) { final Set<String> locations = ProvisioningUtil.realLocation(PropertyPlaceHolderHelper.simpleValue(string)); for (final String location : locations) { final File file = base.getFile(location, false); classpath.add(file.toURI()); } } return classpath.toArray(new URI[classpath.size()]); }
public void setLastValidated(String jarFile, long timeValidated) { try { conn = getConnection(); File jar = SystemInstance.get().getBase().getFile(jarFile); String jarFileURL = jar.toURI().toURL().toExternalForm(); PreparedStatement stmt = null; if (_getLastValidated(jarFileURL) != 0L) { stmt = conn.prepareStatement(_updateValidated); stmt.setLong(1, timeValidated); stmt.setString(2, getVersion()); stmt.setString(3, jarFileURL); } else { stmt = conn.prepareStatement(_insertValidated); stmt.setString(1, jarFileURL); stmt.setLong(2, timeValidated); stmt.setString(3, getVersion()); } stmt.executeUpdate(); stmt.close(); } catch (Exception e) { } finally { try { conn.close(); } catch (Exception e) { } } }
/** * Takes a raw unparsed string expected to be in jvm classpath syntax * and parses it, producing a collection of URIs representing the absolute * file paths of the classpath to be created. * <p/> * OS specific delimiters are supported. * * @param rawstring unparsed string in "classpath" syntax * @return URI array * @throws IOException if path cannot be resolved or file referenced does not exist */ public static URI[] resolveClasspath(final String rawstring) throws IOException { final FileUtils base = SystemInstance.get().getBase(); final String[] strings = rawstring.split(File.pathSeparator); final URI[] classpath = new URI[strings.length]; for (int i = 0; i < strings.length; i++) { final String string = strings[i]; final String pathname = PropertyPlaceHolderHelper.simpleValue(ProvisioningUtil.realLocation(string)); final File file = base.getFile(pathname, false); classpath[i] = file.toURI(); } return classpath; }
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();
config = SystemInstance.get().getBase().getFile(ADDITIONAL_DEPLOYMENTS, false); } catch (final IOException e) { config = null;
config = SystemInstance.get().getBase().getFile(ADDITIONAL_DEPLOYMENTS, false); } catch (final IOException e) { config = null;
final File additionalDeploymentFile = SystemInstance.get().getBase().getFile(ADDITIONAL_DEPLOYMENTS, false);
final File additionalDeploymentFile = SystemInstance.get().getBase().getFile(ADDITIONAL_DEPLOYMENTS, false);