org.apache.openejb.loader.IO.copy()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(5.5k)|赞(0)|评价(0)|浏览(183)

本文整理了Java中org.apache.openejb.loader.IO.copy()方法的一些代码示例,展示了IO.copy()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IO.copy()方法的具体详情如下:
包路径:org.apache.openejb.loader.IO
类名称:IO
方法名:copy

IO.copy介绍

暂无

代码示例

代码示例来源:origin: org.apache.openejb/openejb-loader

  1. private static File copy(final File file, final File lib) throws IOException {
  2. final File dest = new File(lib, file.getName());
  3. if (dest.exists()) {
  4. return dest;
  5. }
  6. IO.copy(file, dest);
  7. return dest;
  8. }

代码示例来源:origin: org.apache.openejb/openejb-loader

  1. public static void copy(final File from, final File to) throws IOException {
  2. if (!from.isDirectory()) {
  3. final FileOutputStream fos = new FileOutputStream(to);
  4. try {
  5. copy(from, fos);
  6. } finally {
  7. close(fos);
  8. }
  9. } else {
  10. copyDirectory(from, to);
  11. }
  12. }

代码示例来源:origin: org.apache.tomee/openejb-loader

  1. public static String slurp(final InputStream in) throws IOException {
  2. final ByteArrayOutputStream out = new ByteArrayOutputStream();
  3. copy(in, out);
  4. return new String(out.toByteArray());
  5. }

代码示例来源:origin: org.apache.tomee/openejb-loader

  1. public static void copy(final File from, final File to) throws IOException {
  2. if (!from.isDirectory()) {
  3. final FileOutputStream fos = new FileOutputStream(to);
  4. try {
  5. copy(from, fos);
  6. } finally {
  7. close(fos);
  8. }
  9. } else {
  10. copyDirectory(from, to);
  11. }
  12. }

代码示例来源:origin: org.apache.openejb/tomee-common

  1. public static void copyFile(File source, File destination) throws IOException {
  2. File destinationDir = destination.getParentFile();
  3. if (!destinationDir.exists() && !destinationDir.mkdirs()) {
  4. throw new IOException("Cannot create directory : " + destinationDir);
  5. }
  6. IO.copy(source, destination);
  7. }

代码示例来源:origin: org.apache.openejb/openejb-loader

  1. public static String slurp(final InputStream in) throws IOException {
  2. final ByteArrayOutputStream out = new ByteArrayOutputStream();
  3. copy(in, out);
  4. return new String(out.toByteArray());
  5. }

代码示例来源:origin: org.apache.openejb/tomee-common

  1. public static void copy(File srcFile, File destFile) throws IOException {
  2. if (destFile.exists() && destFile.isDirectory()) {
  3. throw new IOException("Destination '" + destFile + "' exists but is a directory");
  4. }
  5. IO.copy(srcFile, destFile);
  6. }

代码示例来源:origin: org.apache.tomee/livereload-tomee

  1. @Override
  2. public void init() throws ServletException {
  3. super.init();
  4. try (final InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("js/livereload.js")) {
  5. final ByteArrayOutputStream out = new ByteArrayOutputStream();
  6. IO.copy(is, out);
  7. js = out.toByteArray();
  8. } catch (final IOException e) {
  9. throw new IllegalStateException("impossible to find livereload.js", e);
  10. }
  11. }
  12. }

代码示例来源:origin: org.apache.openejb/openejb-core

  1. private static void copyFile(final File file, final File destFile) throws DeploymentTerminatedException {
  2. try {
  3. IO.copy(file, destFile);
  4. } catch (final Exception e) {
  5. throw new DeploymentTerminatedException(messages.format("cmd.deploy.cantCopy", file.getAbsolutePath(), destFile.getAbsolutePath()));
  6. }
  7. }

代码示例来源:origin: org.apache.tomee/openejb-core

  1. private static void copyFile(final File file, final File destFile) throws DeploymentTerminatedException {
  2. try {
  3. IO.copy(file, destFile);
  4. } catch (final Exception e) {
  5. throw new DeploymentTerminatedException(messages.format("cmd.deploy.cantCopy", file.getAbsolutePath(), destFile.getAbsolutePath()));
  6. }
  7. }

代码示例来源:origin: org.apache.openejb/openejb-loader

  1. public static String copyTryingProxies(final URI source, final File destination) throws Exception {
  2. final InputStream is = inputStreamTryingProxies(source);
  3. if (is == null) {
  4. return null;
  5. }
  6. try {
  7. IO.copy(is, destination);
  8. } finally {
  9. IO.close(is);
  10. }
  11. return destination.getAbsolutePath();
  12. }

代码示例来源:origin: org.apache.openejb/openejb-loader

  1. public static void copy(final File from, final OutputStream to) throws IOException {
  2. final InputStream read = read(from);
  3. try {
  4. copy(read, to);
  5. } finally {
  6. close(read);
  7. }
  8. }

代码示例来源:origin: org.apache.openejb/openejb-loader

  1. public static void copy(final InputStream from, final File to) throws IOException {
  2. final OutputStream write = write(to);
  3. try {
  4. copy(from, write);
  5. } finally {
  6. close(write);
  7. }
  8. }

代码示例来源:origin: org.apache.tomee/openejb-loader

  1. public static void copy(final File from, final OutputStream to) throws IOException {
  2. final InputStream read = read(from);
  3. try {
  4. copy(read, to);
  5. } finally {
  6. close(read);
  7. }
  8. }

代码示例来源:origin: org.apache.tomee/openejb-loader

  1. public static void copy(final URL from, final OutputStream to) throws IOException {
  2. final InputStream read = read(from);
  3. try {
  4. copy(read, to);
  5. } finally {
  6. close(read);
  7. }
  8. }

代码示例来源:origin: org.apache.tomee/openejb-loader

  1. public static void copy(final InputStream from, final File to, final boolean append) throws IOException {
  2. final OutputStream write = write(to, append);
  3. try {
  4. copy(from, write);
  5. } finally {
  6. close(write);
  7. }
  8. }

代码示例来源:origin: org.apache.openejb/openejb-loader

  1. public static void copy(final URL from, final OutputStream to) throws IOException {
  2. final InputStream read = read(from);
  3. try {
  4. copy(read, to);
  5. } finally {
  6. close(read);
  7. }
  8. }

代码示例来源:origin: org.apache.tomee/openejb-core

  1. public static File createConfig(final File config) throws IOException {
  2. final ResourceFinder finder = new ResourceFinder("");
  3. final URL defaultConfig = finder.find("default.openejb.conf");
  4. IO.copy(IO.read(defaultConfig), config);
  5. return config;
  6. }

代码示例来源:origin: org.apache.openejb/openejb-core

  1. public static File createConfig(final File config) throws IOException {
  2. final ResourceFinder finder = new ResourceFinder("");
  3. final URL defaultConfig = finder.find("default.openejb.conf");
  4. IO.copy(IO.read(defaultConfig), config);
  5. return config;
  6. }

代码示例来源:origin: com.tomitribe.tribestream/tribestream-api-gateway-backbone

  1. private static void updateBinFile(final File binDir, final String binFile, final String changes) throws IOException {
  2. final URL agent = getResource(changes);
  3. final File catalinaSh = file(binDir, binFile);
  4. String content = IO.slurp(catalinaSh);
  5. content = content.replace("# ----- Execute The Requested Command", IO.slurp(agent));
  6. IO.copy(IO.read(content), catalinaSh);
  7. }

相关文章