Пример #1
0
  public static void copyFile(File from, File to) throws IOException {

    final InputStream input = new FileInputStream(from);
    final OutputStream output = new FileOutputStream(to);
    // get an channel from the stream
    copyStreams(input, output);
  }
Пример #2
0
  public static void copyFile(String from, String to) throws IOException {

    final InputStream input = new FileInputStream(from);
    final OutputStream output = new FileOutputStream(to);
    try {
      // get an channel from the stream
      copyStreams(input, output);
    } finally {
      input.close();
      output.close();
    }
  }