本文整理了Java中org.apache.openejb.loader.IO.read()
方法的一些代码示例,展示了IO.read()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IO.read()
方法的具体详情如下:
包路径:org.apache.openejb.loader.IO
类名称:IO
方法名:read
[英]Reads and closes the input stream
[中]读取并关闭输入流
代码示例来源:origin: org.apache.openejb/openejb-core
@Override
public InputStream get() throws IOException {
return IO.read(url);
}
}
代码示例来源:origin: org.apache.openejb/openejb-loader
public static Properties readProperties(final File resource, final Properties properties) throws IOException {
return readProperties(read(resource), properties);
}
代码示例来源:origin: org.apache.openejb/openejb-core
private void tryRemote(final String uriStr) throws IOException {
try {
url = new URL(URLEncoder.encode(uriStr, "UTF-8"));
uri = URLs.uri(url.toString());
is = IO.read(url);
} catch (final MalformedURLException e) {
// do nothing
}
}
代码示例来源:origin: org.apache.tomee/openejb-loader
public static Properties readProperties(final URL resource, final Properties properties) throws IOException {
return readProperties(read(resource), properties);
}
代码示例来源:origin: org.apache.tomee/openejb-core
private void tryRemote(final String uriStr) throws IOException {
try {
url = new URL(URLEncoder.encode(uriStr, "UTF-8"));
uri = URLs.uri(url.toString());
is = IO.read(url);
} catch (final MalformedURLException e) {
// do nothing
}
}
代码示例来源:origin: org.apache.openejb/openejb-core
private static Properties asProperties(final String definition) throws IOException {
final SuperProperties properties = new SuperProperties();
properties.caseInsensitive(true);
properties.putAll(IO.readProperties(IO.read(definition), new Properties()));
return properties;
}
代码示例来源:origin: org.apache.tomee/openejb-loader
public static String slurp(final File file) throws IOException {
try (final InputStream is = read(file)) {
return slurp(is);
}
}
代码示例来源:origin: org.apache.tomee/openejb-core
private static Properties asProperties(final String definition) throws IOException {
final SuperProperties properties = new SuperProperties();
properties.caseInsensitive(true);
properties.putAll(IO.readProperties(IO.read(definition), new Properties()));
return properties;
}
代码示例来源:origin: org.apache.openejb/openejb-loader
public static String slurp(final File file) throws IOException {
return slurp(read(file));
}
代码示例来源:origin: org.apache.openejb/openejb-loader
public static void copy(final File from, final OutputStream to) throws IOException {
final InputStream read = read(from);
try {
copy(read, to);
} finally {
close(read);
}
}
代码示例来源:origin: org.apache.openejb/openejb-loader
public static void copy(final URL from, final OutputStream to) throws IOException {
final InputStream read = read(from);
try {
copy(read, to);
} finally {
close(read);
}
}
代码示例来源:origin: org.apache.tomee/openejb-loader
public static void copy(final File from, final OutputStream to) throws IOException {
final InputStream read = read(from);
try {
copy(read, to);
} finally {
close(read);
}
}
代码示例来源:origin: org.apache.tomee/openejb-loader
public static void copy(final URL from, final OutputStream to) throws IOException {
final InputStream read = read(from);
try {
copy(read, to);
} finally {
close(read);
}
}
代码示例来源:origin: com.tomitribe.tribestream/tribestream-api-gateway-backbone
private static void installResource(final File conf, final String file) throws IOException {
final URL resource = getResource("/" + file);
IO.copy(IO.read(resource), IO.write(new File(conf, file)));
}
代码示例来源:origin: org.apache.tomee/openejb-core
public static File createConfig(final File config) throws IOException {
final ResourceFinder finder = new ResourceFinder("");
final URL defaultConfig = finder.find("default.openejb.conf");
IO.copy(IO.read(defaultConfig), config);
return config;
}
代码示例来源:origin: org.apache.openejb/openejb-core
public static File createConfig(final File config) throws IOException {
final ResourceFinder finder = new ResourceFinder("");
final URL defaultConfig = finder.find("default.openejb.conf");
IO.copy(IO.read(defaultConfig), config);
return config;
}
代码示例来源:origin: org.apache.openejb/openejb-provisionning
public InputStream resolve(String groupId, String artifactId, String classifier, String extension, String version) throws IOException {
// version = mapLatestToRange( version );
final RepositorySystemSession session = newSession();
Artifact artifact = new DefaultArtifact(groupId, artifactId, classifier, extension, version);
File resolved = resolve(session, artifact);
return IO.read(resolved);
}
代码示例来源:origin: com.tomitribe.tribestream/tribestream-api-gateway-backbone
private static void updateBinFile(final File binDir, final String binFile, final String changes) throws IOException {
final URL agent = getResource(changes);
final File catalinaSh = file(binDir, binFile);
String content = IO.slurp(catalinaSh);
content = content.replace("# ----- Execute The Requested Command", IO.slurp(agent));
IO.copy(IO.read(content), catalinaSh);
}
代码示例来源:origin: org.apache.openejb/openejb-loader
public static void unzip(final File zipFile, final File destination, final boolean noparent) throws IOException {
Files.dir(destination);
Files.writable(destination);
Files.file(zipFile);
Files.readable(zipFile);
final InputStream read = IO.read(zipFile);
try {
unzip(read, destination, noparent);
} finally {
IO.close(read);
}
}
代码示例来源:origin: org.apache.tomee/openejb-loader
public static void unzip(final File zipFile, final File destination, final boolean noparent) throws IOException {
Files.dir(destination);
Files.writable(destination);
Files.file(zipFile);
Files.readable(zipFile);
final InputStream read = IO.read(zipFile);
try {
unzip(read, destination, noparent);
} finally {
IO.close(read);
}
}
内容来源于网络,如有侵权,请联系作者删除!