public void copy(File src, File dst) throws IOException {
//if the parameters are same,then don't excute anything.or it make original file null.
if(!src.getAbsolutePath().equalsIgnoreCase(dst.getAbsolutePath())){
InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dst);
// Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
in.close();
out.close();
}
}