Monday, 2 September 2013

logic to select the zip file from source and sending it to another directory

logic to select the zip file from source and sending it to another directory

I am stuck up in an odd situation that ia I have a folder in C: named
sourceconsists of one .dat file and one .zip file now I want to move only
zip file to another diretory in c : named target
1) Now first I have to write the logic to pick up the .zip file from
source folder
what I HAVE TRIED IS ...
private void filemove(String FilePath2, String s2) { filepath2 contains
the location of source c:\\source
String destination ="C:\\target\\"
try {
File f = new File(FilePath2);
if (f.getName().endsWith(".zip")) {
//please advise the logic to copy the file to destination folder
}
} catch (Exception e) {
e.printStackTrace();
}
}
please advise the logic to copy the files to destination folder

No comments:

Post a Comment