本文整理了Java中org.apache.openejb.loader.FileUtils.getFile()
方法的一些代码示例,展示了FileUtils.getFile()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtils.getFile()
方法的具体详情如下:
包路径:org.apache.openejb.loader.FileUtils
类名称:FileUtils
方法名:getFile
暂无
代码示例来源:origin: org.apache.openejb/openejb-loader
public File getFile(final String path) throws IOException {
return getFile(path, true);
}
代码示例来源:origin: org.apache.tomee/openejb-loader
public File getFile(final String path) throws IOException {
return getFile(path, true);
}
代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-loader
public File getFile(String path) throws java.io.FileNotFoundException, java.io.IOException {
return getFile(path, true);
}
代码示例来源:origin: com.tomitribe.tribestream/tribestream-container
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;
}
代码示例来源:origin: com.tomitribe.tribestream/tribestream-container
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;
}
}
代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core
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;
}
}
代码示例来源:origin: org.apache.tomee/openejb-core
/**
* 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()]);
}
代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core
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) {
}
}
}
代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core
File jar = path.getFile(dep.getJar(), false);
if (!jarList.contains(jar.getAbsolutePath())) {
jarList.add(jar.getAbsolutePath());
dir = path.getFile(dep.getDir(), false);
} catch (Exception ignored) {
代码示例来源:origin: org.apache.openejb/openejb-core
/**
* 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;
}
代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core
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();
代码示例来源:origin: org.apache.tomee/openejb-core
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();
代码示例来源:origin: org.apache.openejb/openejb-core
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();
代码示例来源:origin: org.apache.openejb/openejb-core
final File target = SystemInstance.get().getBase().getFile(d.getFile(), false);
final File target = SystemInstance.get().getBase().getFile(d.getDir(), false);
final File jarDir = jar.getAbsoluteFile().getParentFile();
代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core
File target = SystemInstance.get().getBase().getFile(d.getJar(), false);
File target = SystemInstance.get().getBase().getFile(d.getDir(), false);
File jarDir = jar.getAbsoluteFile().getParentFile();
代码示例来源:origin: org.apache.tomee/openejb-core
final File target = SystemInstance.get().getBase().getFile(d.getFile(), false);
final File target = SystemInstance.get().getBase().getFile(d.getDir(), false);
final File jarDir = jar.getAbsoluteFile().getParentFile();
代码示例来源:origin: org.apache.openejb/openejb-core
config = SystemInstance.get().getBase().getFile(ADDITIONAL_DEPLOYMENTS, false);
} catch (final IOException e) {
config = null;
代码示例来源:origin: org.apache.tomee/openejb-core
config = SystemInstance.get().getBase().getFile(ADDITIONAL_DEPLOYMENTS, false);
} catch (final IOException e) {
config = null;
代码示例来源:origin: org.apache.openejb/openejb-core
final File additionalDeploymentFile = SystemInstance.get().getBase().getFile(ADDITIONAL_DEPLOYMENTS, false);
代码示例来源:origin: org.apache.tomee/openejb-core
final File additionalDeploymentFile = SystemInstance.get().getBase().getFile(ADDITIONAL_DEPLOYMENTS, false);
内容来源于网络,如有侵权,请联系作者删除!