public static final boolean fileCopy( String FILE_FROM,String FILE_TO ) {
File fileFrom = new File(FILE_FROM);
File fileBac = new File(FILE_TO);
boolean success = true;
try {
if ( !fileFrom.exists() ) {
return false;
}
if ( !fileBac.exists() ) {
success = fileBac.createNewFile();
}
} catch (IOException e) {
return false;
}
try {
if (success) {
FileInputStream input = new FileInputStream(fileFrom);
FileOutputStream output = new FileOutputStream(fileBac);
byte[] bytes = new byte[1024];
int count = 0;
while( ( count = input.read(bytes) ) != -1 ) {
output.write(bytes, 0, count);
}
input.close();
output.close();
} else {
}
} catch (IOException e) {return false ;}
return true ;
}