equal
deleted
inserted
replaced
29 import java.lang.ref.SoftReference; |
29 import java.lang.ref.SoftReference; |
30 import java.net.URI; |
30 import java.net.URI; |
31 import java.nio.file.DirectoryStream; |
31 import java.nio.file.DirectoryStream; |
32 import java.nio.file.FileSystem; |
32 import java.nio.file.FileSystem; |
33 import java.nio.file.FileSystems; |
33 import java.nio.file.FileSystems; |
|
34 import java.nio.file.FileSystemNotFoundException; |
34 import java.nio.file.Files; |
35 import java.nio.file.Files; |
35 import java.nio.file.Path; |
36 import java.nio.file.Path; |
|
37 import java.nio.file.ProviderNotFoundException; |
36 import java.nio.file.spi.FileSystemProvider; |
38 import java.nio.file.spi.FileSystemProvider; |
37 import java.util.Collections; |
39 import java.util.Collections; |
38 import java.util.HashMap; |
40 import java.util.HashMap; |
39 import java.util.LinkedHashMap; |
41 import java.util.LinkedHashMap; |
40 import java.util.LinkedHashSet; |
42 import java.util.LinkedHashSet; |
77 throw new UncheckedIOException(e); |
79 throw new UncheckedIOException(e); |
78 } |
80 } |
79 } |
81 } |
80 |
82 |
81 public static boolean isAvailable() { |
83 public static boolean isAvailable() { |
82 for (FileSystemProvider p: FileSystemProvider.installedProviders()) { |
84 try { |
83 if (p.getScheme().equals("jrt")) |
85 FileSystems.getFileSystem(URI.create("jrt:/")); |
84 return true; |
86 return true; |
85 } |
87 } catch (ProviderNotFoundException | FileSystemNotFoundException e) { |
86 return false; |
88 return false; |
|
89 } |
87 } |
90 } |
88 |
91 |
89 |
92 |
90 /** |
93 /** |
91 * The jrt: file system. |
94 * The jrt: file system. |