Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.nio.file.Path;
- public class GetFolderSize_08 {
- public static void main(String[] args) {
- String path = "C:\\Users\\I353529\\Documents\\SoftUni\\Exercises Resources";
- File folder = new File(path);
- int folderSize = 0;
- for (File file : folder.listFiles()) {
- folderSize += file.length();
- }
- System.out.println("Folder size: " + folderSize);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment