Skip to content

Commit 95fb842

Browse files
committed
use Files.newInputStream
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
1 parent 0c66f91 commit 95fb842

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • bundles/org.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/internal/util/preprocessor

bundles/org.openhab.core.model.yaml/src/main/java/org/openhab/core/model/yaml/internal/util/preprocessor/YamlPreprocessor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
*/
1313
package org.openhab.core.model.yaml.internal.util.preprocessor;
1414

15-
import java.io.FileInputStream;
1615
import java.io.IOException;
1716
import java.io.InputStream;
17+
import java.nio.file.Files;
1818
import java.nio.file.Path;
1919
import java.util.HashMap;
2020
import java.util.HashSet;
@@ -109,7 +109,7 @@ static Object load(Path file, Map<String, String> variables, Set<Path> includeSt
109109
}
110110

111111
private static Object loadYaml(Path path, Map<String, String> variables) throws IOException {
112-
try (InputStream inputStream = new FileInputStream(path.toFile())) {
112+
try (InputStream inputStream = Files.newInputStream(path)) {
113113
Yaml yaml = newYaml(variables);
114114
return yaml.load(inputStream);
115115
} // let the caller catch the exception and log a message

0 commit comments

Comments
 (0)