Do not use FileInputStream
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / repo / util / FilesystemSchemaSourceCache.java
index e2d7d5d2b74fe85a95a4ed1704c79b66a0e9f05f..0eb7fc00138c7f556d0d8b0cd8c0bc6fab9f2095 100644 (file)
@@ -15,7 +15,6 @@ import com.google.common.collect.Lists;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.io.InputStream;
@@ -261,7 +260,7 @@ public final class FilesystemSchemaSourceCache<T extends SchemaSourceRepresentat
 
                 @Override
                 public InputStream openStream() throws IOException {
-                    return new FileInputStream(cachedSource);
+                    return Files.newInputStream(cachedSource.toPath());
                 }
             };
         }