This is my current code:
File f = new File(folder, fileName);
if (!f.exists()) {
log.warn("Unable to find file");
}
else{
f.delete();
}
My problem is that this will always be true in the current context since I have two subfolders that have been generated and hashed. So let's assume I have a leading directory called "data storage" with two sub-directories with randomly hashed names. The file is within the two subdirectories. Is there an easy way to check if my file is within an entire directory, including sub-directories?
Thanks!