Here you can find the source of workaroundCopyFile(final File src, final File dest)
protected static void workaroundCopyFile(final File src, final File dest) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; public class Main { protected static void workaroundCopyFile(final File src, final File dest) throws IOException { FileInputStream from = null; FileOutputStream to = null; try {// w w w.ja v a2 s .c o m from = new FileInputStream(src); to = new FileOutputStream(dest); byte[] buffer = new byte[4096]; int bytesRead; while ((bytesRead = from.read(buffer)) != -1) { to.write(buffer, 0, bytesRead); } } finally { if (from != null) { try { from.close(); } catch (IOException e) { e.printStackTrace(); } } if (to != null) { try { to.close(); } catch (IOException e) { e.printStackTrace(); } } } } }