public interface FileResource
File
and ZipEntry
.Modifier and Type | Method and Description |
---|---|
java.lang.String |
absolutePath() |
boolean |
canExecute() |
java.lang.String |
canonicalPath() |
boolean |
canRead() |
boolean |
canWrite() |
int |
errno() |
boolean |
exists() |
default JRubyFile |
hackyGetJRubyFile()
Deprecated.
|
default java.io.InputStream |
inputStream()
Deprecated.
Opens a new input stream to read the contents of a resource and returns it.
Note that implementations may be allocating native memory for the stream, so
callers need to close this when they are done with it. users of this
method should follow the pattern: close the stream where you open it.
|
boolean |
isDirectory() |
boolean |
isFile() |
default boolean |
isNull() |
boolean |
isSymLink() |
long |
lastModified() |
long |
length() |
java.lang.String[] |
list() |
jnr.posix.FileStat |
lstat() |
java.nio.channels.Channel |
openChannel(int flags,
int perm) |
default java.nio.channels.Channel |
openChannel(ModeFlags flags,
int perm)
Deprecated.
use
openChannel(int, int) instead |
java.io.InputStream |
openInputStream()
Opens a new input stream to read the contents of a resource and returns it.
|
jnr.posix.FileStat |
stat() |
<T> T |
unwrap(java.lang.Class<T> type)
Unwrap the resource backend (replacement for
hackyGetJRubyFile() ). |
static FileResource |
wrap(jnr.posix.POSIX posix,
JRubyFile file) |
static FileResource wrap(jnr.posix.POSIX posix, JRubyFile file)
java.lang.String absolutePath()
java.lang.String canonicalPath()
boolean exists()
boolean isDirectory()
boolean isFile()
boolean canExecute()
int errno()
long lastModified()
long length()
boolean canRead()
boolean canWrite()
default boolean isNull()
java.lang.String[] list()
File.list()
boolean isSymLink()
jnr.posix.FileStat stat()
jnr.posix.FileStat lstat()
<T> T unwrap(java.lang.Class<T> type) throws java.lang.UnsupportedOperationException
hackyGetJRubyFile()
).T
- type
- java.lang.UnsupportedOperationException
@Deprecated default JRubyFile hackyGetJRubyFile()
default java.io.InputStream inputStream() throws ResourceException
ResourceException
- is the file does not exists or if the resource is a directoryjava.io.InputStream openInputStream() throws java.io.IOException
java.io.IOException
default java.nio.channels.Channel openChannel(ModeFlags flags, int perm) throws ResourceException
openChannel(int, int)
insteadflags
- perm
- ResourceException
java.nio.channels.Channel openChannel(int flags, int perm) throws java.io.IOException
java.io.IOException
Copyright © 2001-2018 JRuby. All Rights Reserved.