public abstract class Fs extends Object
Constructor and Description |
---|
Fs() |
Modifier and Type | Method and Description |
---|---|
static String |
externalize(Path path) |
static Path |
fileFromPath(String path)
Deprecated.
Use
fromUrl(String) instead. |
static FileSystem |
forJar(Path jarFile) |
static FileSystem |
forJar(URL url) |
static Path |
fromUrl(String urlString)
Use this method instead of
Paths.get(String, String...) or Paths.get(URI) . |
static Path |
fromUrl(URL url)
Isn’t this what
Paths.get(URI) should do? |
static byte[] |
getBytes(Path path) |
static InputStream |
getInputStream(Path path) |
static Path |
join(Path path,
String... pathParts) |
static String[] |
listFileNames(Path path) |
static Path[] |
listFiles(Path path) |
static Path[] |
listFiles(Path path,
Predicate<Path> filter) |
static Path |
newFile(File file)
Deprecated.
Use
File.toPath() instead. |
static URI |
toUri(URL url) |
@Deprecated public static Path newFile(File file)
File.toPath()
instead.@Deprecated public static Path fileFromPath(String path)
fromUrl(String)
instead.public static FileSystem forJar(URL url)
public static FileSystem forJar(Path jarFile)
public static Path fromUrl(String urlString)
Use this method instead of Paths.get(String, String...)
or Paths.get(URI)
.
Supports “file:path”, “jar:file:jarfile.jar!/path”, and plain old paths.
For JAR files, automatically open and cache filesystems.
public static Path fromUrl(URL url)
Isn’t this what Paths.get(URI)
should do?
public static InputStream getInputStream(Path path) throws IOException
IOException
public static byte[] getBytes(Path path) throws IOException
IOException
public static Path[] listFiles(Path path) throws IOException
IOException
public static Path[] listFiles(Path path, Predicate<Path> filter) throws IOException
IOException