[FIX] close scanner

This commit is contained in:
RatzzFatzz
2020-04-10 20:51:18 +02:00
parent 9c0682c761
commit 0d74b00487

View File

@@ -18,17 +18,17 @@ public class AttributeUpdaterKernel {
public void execute() { public void execute() {
List<AttributeConfig> configPattern = ConfigUtil.loadConfig(); List<AttributeConfig> configPattern = ConfigUtil.loadConfig();
Scanner scanner = new Scanner(System.in);
System.out.println("Please enter the path to the files which should be updated: ");
List<File> allValidPaths = null; List<File> allValidPaths = null;
do{ try(Scanner scanner = new Scanner(System.in)){
allValidPaths = collector.loadFiles(scanner.nextLine()); System.out.println("Please enter the path to the files which should be updated: ");
if(allValidPaths == null){ do{
System.out.println("Please enter a valid path: "); allValidPaths = collector.loadFiles(scanner.nextLine());
} if(allValidPaths == null){
}while(allValidPaths == null); System.out.println("Please enter a valid path: ");
log.info(allValidPaths.size() + " files where found and will now be processed!"); }
}while(allValidPaths == null);
log.info(allValidPaths.size() + " files where found and will now be processed!");
}
for(File file : allValidPaths){ for(File file : allValidPaths){
List<FileAttribute> attributes = collector.loadAttributes(file); List<FileAttribute> attributes = collector.loadAttributes(file);
for(AttributeConfig config : configPattern){ for(AttributeConfig config : configPattern){