Package org.robolectric.res
Class Fs
- java.lang.Object
-
- org.robolectric.res.Fs
-
public abstract class Fs extends Object
-
-
Constructor Summary
Constructors Constructor Description Fs()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
externalize(Path path)
static Path
fileFromPath(String path)
Deprecated.UsefromUrl(String)
instead.static FileSystem
forJar(URL url)
static FileSystem
forJar(Path jarFile)
static Path
fromUrl(String urlString)
Use this method instead ofPaths.get(String, String...)
orPaths.get(URI)
.static Path
fromUrl(URL url)
Isn't this whatPaths.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.UseFile.toPath()
instead.static URI
toUri(URL url)
-
-
-
Method Detail
-
newFile
@Deprecated public static Path newFile(File file)
Deprecated.UseFile.toPath()
instead.
-
fileFromPath
@Deprecated public static Path fileFromPath(String path)
Deprecated.UsefromUrl(String)
instead.
-
forJar
public static FileSystem forJar(URL url)
-
forJar
public static FileSystem forJar(Path jarFile)
-
fromUrl
public static Path fromUrl(String urlString)
Use this method instead ofPaths.get(String, String...)
orPaths.get(URI)
.Supports "file:path", "jar:file:jarfile.jar!/path", and plain old paths.
For JAR files, automatically open and cache filesystems.
-
fromUrl
public static Path fromUrl(URL url)
Isn't this whatPaths.get(URI)
should do?
-
getInputStream
public static InputStream getInputStream(Path path) throws IOException
- Throws:
IOException
-
getBytes
public static byte[] getBytes(Path path) throws IOException
- Throws:
IOException
-
listFiles
public static Path[] listFiles(Path path) throws IOException
- Throws:
IOException
-
listFiles
public static Path[] listFiles(Path path, Predicate<Path> filter) throws IOException
- Throws:
IOException
-
-