Package org.jruby.util
Class EmptyFileResource
java.lang.Object
org.jruby.util.EmptyFileResource
- All Implemented Interfaces:
FileResource
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancanRead()booleancanWrite()static EmptyFileResourceinterrno()booleanexists()booleanbooleanisFile()booleanlonglonglength()String[]list()jnr.posix.FileStatlstat()openChannel(int flags, int perm) Opens a new input stream to read the contents of a resource and returns it.path()jnr.posix.FileStatstat()toString()<T> TUnwrap the resource backend (replacement forFileResource.hackyGetJRubyFile()).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jruby.util.FileResource
hackyGetJRubyFile, inputStream, isNull, openChannel
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
EmptyFileResource
EmptyFileResource()
-
-
Method Details
-
create
-
absolutePath
- Specified by:
absolutePathin interfaceFileResource
-
canonicalPath
- Specified by:
canonicalPathin interfaceFileResource
-
path
- Specified by:
pathin interfaceFileResource
-
exists
public boolean exists()- Specified by:
existsin interfaceFileResource
-
isDirectory
public boolean isDirectory()- Specified by:
isDirectoryin interfaceFileResource
-
isFile
public boolean isFile()- Specified by:
isFilein interfaceFileResource
-
canExecute
public boolean canExecute()- Specified by:
canExecutein interfaceFileResource
-
canRead
public boolean canRead()- Specified by:
canReadin interfaceFileResource
-
canWrite
public boolean canWrite()- Specified by:
canWritein interfaceFileResource
-
isSymLink
public boolean isSymLink()- Specified by:
isSymLinkin interfaceFileResource
-
list
- Specified by:
listin interfaceFileResource- See Also:
-
lastModified
public long lastModified()- Specified by:
lastModifiedin interfaceFileResource
-
length
public long length()- Specified by:
lengthin interfaceFileResource
-
stat
public jnr.posix.FileStat stat()- Specified by:
statin interfaceFileResource
-
lstat
public jnr.posix.FileStat lstat()- Specified by:
lstatin interfaceFileResource
-
errno
public int errno()- Specified by:
errnoin interfaceFileResource
-
openInputStream
Description copied from interface:FileResourceOpens 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.- Specified by:
openInputStreamin interfaceFileResource- Returns:
- InputStream
- Throws:
IOException
-
openChannel
- Specified by:
openChannelin interfaceFileResource- Throws:
IOException
-
unwrap
Description copied from interface:FileResourceUnwrap the resource backend (replacement forFileResource.hackyGetJRubyFile()).- Specified by:
unwrapin interfaceFileResource- Returns:
- backend if supported
- Throws:
UnsupportedOperationException
-
toString
-