Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.IOException;
- public class DirProcessor
- {
- public DirProcessor(FileProcessor fileProcessor) {
- this.fileProcessor = fileProcessor;
- }
- FileProcessor fileProcessor;
- public int countSymbolsFromPackage(String folderPath) throws IOException
- {
- File folder = new File(folderPath);
- File[] listOfFiles = folder.listFiles();
- int sum = 0;
- for (File file : listOfFiles) {
- String filePath = file.getPath();
- if (filePath.contains(".txt")) {
- sum += fileProcessor.countSymbols(filePath);
- }
- }
- return sum;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement