Hi i am new to java and i want to know how to access the files in the folder.
My requirement is that, I am successfully compressing an image files and then writing it into a temporary file. Now i want to access each file in the folder so that i can check the size of the files individually to perform some operations.
Please tell me how to access each file in the folder dynamically.
This is the code to compress and then access the folder.
BufferedImage resizeImageBmp = resizeImage(originalImage, type);
ImageIO.write(resizeImageBmp, "png", new File(tempDir + roots[i].getName())); //Compressing the file
String Temp = tempDir; //Path to the temporary folder
//Temp1 = ((Temp.length() / 1024)/1024);
if((Temp.length()) > 6){
//writeToDir(Temp,failureDir);
//System.out.println(Temp);
System.out.println(Temp);
}
else{
//System.out.println(Temp);
System.out.println(Temp);
}
File