Close scanner after use
parent
ef95740a7b
commit
16fd96b3b6
|
@ -22,7 +22,9 @@ public class FileManager {
|
|||
} else {
|
||||
Scanner fileReader = new Scanner(newFile);
|
||||
// using the delimiter \\Z reads the entire file at once
|
||||
return fileReader.useDelimiter("\\Z").next();
|
||||
String returnString = fileReader.useDelimiter("\\Z").next();
|
||||
fileReader.close();
|
||||
return returnString;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue