Cleanup - File IO streams

This commit is contained in:
Jetz
2024-08-10 11:09:31 -04:00
parent 8e3d02f1aa
commit 09c76a4dc8
11 changed files with 23 additions and 31 deletions

View File

@@ -16,10 +16,10 @@
package forge.lda.lda.inference;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Properties;
public class InferenceProperties {
@@ -63,8 +63,8 @@ public class InferenceProperties {
}
class PropertiesLoader {
public InputStream getInputStream(String fileName) throws FileNotFoundException {
public InputStream getInputStream(String fileName) throws IOException {
if (fileName == null) throw new NullPointerException();
return new FileInputStream(fileName);
return Files.newInputStream(Paths.get(fileName));
}
}