Possible Duplicate:
Copying files from one directory to another in Java
I have a folder (c:/InstallationFiles) with .jar files in it. i want to read through it and if the name equals test1 i want to copy it to a test1 folder, then if the name is test2 copy it to a test2 folder etc. this is what i have so far:
private static int copyJARFiles() {
resultCode = 0;
File installFolder = new File(Constants.WINDOWS + Constants.INSTALLATION_FOLDER);
File[] installFiles = installFolder.listFiles();
for (int i = 0; i < installFiles.length; i++) {
if (installFiles[i].equals("test1.jar")){
}
if (installFiles[i].equals("test2.jar")){
}
}
return resultCode;
}
not sure how to copy it then. im still a rookie.
thank you / kind regards