[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() {
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;
do{
allValidPaths = collector.loadFiles(scanner.nextLine());
if(allValidPaths == null){
System.out.println("Please enter a valid path: ");
}
}while(allValidPaths == null);
log.info(allValidPaths.size() + " files where found and will now be processed!");
try(Scanner scanner = new Scanner(System.in)){
System.out.println("Please enter the path to the files which should be updated: ");
do{
allValidPaths = collector.loadFiles(scanner.nextLine());
if(allValidPaths == null){
System.out.println("Please enter a valid path: ");
}
}while(allValidPaths == null);
log.info(allValidPaths.size() + " files where found and will now be processed!");
}
for(File file : allValidPaths){
List<FileAttribute> attributes = collector.loadAttributes(file);
for(AttributeConfig config : configPattern){