Change copyFile to version used by Java 1.6