public static boolean copyTo( String sDest , String sSource ) throws Exception {
FileInputStream fi = new FileInputStream( sSource );
try {
FileOutputStream fo = new FileOutputStream( sDest ,false );
try {
fo.getChannel().tryLock();
byte buf [] = new byte[4096];
int readed;
while( (readed = fi.read(buf)) != -1 ) {
fo.write(buf, 0 , readed);
}
} finally {
fo.close();
}
} finally {
fi.close();
}
return true;
}