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

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

本文整理了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

private static File copy(final File file, final File lib) throws IOException {
  final File dest = new File(lib, file.getName());
  if (dest.exists()) {
    return dest;
  }
  IO.copy(file, dest);
  return dest;
}

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

public static void copy(final File from, final File to) throws IOException {
  if (!from.isDirectory()) {
    final FileOutputStream fos = new FileOutputStream(to);
    try {
      copy(from, fos);
    } finally {
      close(fos);
    }
  } else {
    copyDirectory(from, to);
  }
}

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

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

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

public static void copy(final File from, final File to) throws IOException {
  if (!from.isDirectory()) {
    final FileOutputStream fos = new FileOutputStream(to);
    try {
      copy(from, fos);
    } finally {
      close(fos);
    }
  } else {
    copyDirectory(from, to);
  }
}

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

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

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

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

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

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

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

@Override
  public void init() throws ServletException {
    super.init();
    try (final InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("js/livereload.js")) {
      final ByteArrayOutputStream out = new ByteArrayOutputStream();
      IO.copy(is, out);
      js = out.toByteArray();
    } catch (final IOException e) {
      throw new IllegalStateException("impossible to find livereload.js", e);
    }
  }
}

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

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

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

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

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

public static String copyTryingProxies(final URI source, final File destination) throws Exception {
  final InputStream is = inputStreamTryingProxies(source);
  if (is == null) {
    return null;
  }
  try {
    IO.copy(is, destination);
  } finally {
    IO.close(is);
  }
  return destination.getAbsolutePath();
}

代码示例来源: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 InputStream from, final File to) throws IOException {
  final OutputStream write = write(to);
  try {
    copy(from, write);
  } finally {
    close(write);
  }
}

代码示例来源: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: org.apache.tomee/openejb-loader

public static void copy(final InputStream from, final File to, final boolean append) throws IOException {
  final OutputStream write = write(to, append);
  try {
    copy(from, write);
  } finally {
    close(write);
  }
}

代码示例来源: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-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: 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);
}

相关文章