Here is a file copy example
boolean fileCopied = false;
InputStream in = null;
OutputStream out = null;
String sepr = System.getProperty("file.separator");
try {
in = new FileInputStream(path+sepr+srcFileName);
File newFile = new File(path+sepr+targetFileName);
out = new FileOutputStream(path+sepr+targetFileName);
byte[] buffer = new byte[2048];
while (true) {
synchronized (buffer) {
int length = in.read(buffer);
if (length != -1) {
out.write(buffer, 0, length);
}
else
break;
}
}
File oldFile = new File(path+sepr+srcFileName);
fileCopied = newFile.exists();
}
catch(Throwable t){
//handle exceptions here.
}
finally {
try{
if (in != null) { in.close();}
if (out != null) { out.close(); }
}catch(Throwable t1){}
}
return fileCopied;
Hope this helps