Hi i’m working on a simple program and for the set up of the program i need the program to check a directory for zip files and any zip files in there need to be moved into another folder.
Lets say i have folder1 and it contains 6 zip files and then i have another folder called folder2 that i need all the zips and only the zips in folder1 moved to folder2
Thank you for any help one this problem.
Btw i’m a noob so any code samples would be greatly appreciated
For each file in
folder1, useString#endsWith()to see if the file name ends with".zip". If it does, move it tofolder2.FilenameFilterprovides a nice way to do this (though it’s not strictly necessary).It would look something like this (not tested):