|
|
|
@ -228,10 +228,10 @@ public class FileUtils {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static Path getPath(URI uri, String first, String... more) throws IOException { |
|
|
|
|
FileSystem fileSystem = FileSystems.newFileSystem(uri, Collections.<String, String>emptyMap()); |
|
|
|
|
|
|
|
|
|
try (FileSystem fileSystem = getFileSystem(uri)) { |
|
|
|
|
return fileSystem.getPath(first, more); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static Path findFile(Path directoryPath, String fileName) { |
|
|
|
|
File[] files = directoryPath.toFile().listFiles(); |
|
|
|
@ -253,4 +253,13 @@ public class FileUtils {
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static FileSystem getFileSystem(URI uri) throws IOException { |
|
|
|
|
FileSystem fileSystem = FileSystems.getFileSystem(uri); |
|
|
|
|
if (fileSystem != null) { |
|
|
|
|
return fileSystem; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return FileSystems.newFileSystem(uri, Collections.<String, String>emptyMap()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|