Package org.jruby.util
Class NullDeviceResource
java.lang.Object
org.jruby.util.NullDeviceResource
- All Implemented Interfaces:
FileResource
Represents a the NUL: device on Windows, which is not a normal file.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancanRead()booleancanWrite()private ChannelcreateChannel(ModeFlags flags) interrno()booleanexists()booleanbooleanisFile()booleanisNull()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, openChannel
-
Field Details
-
NUL_DEVICE
- See Also:
-
file
-
-
Constructor Details
-
NullDeviceResource
NullDeviceResource()
-
-
Method Details
-
absolutePath
- Specified by:
absolutePathin interfaceFileResource
-
canonicalPath
- Specified by:
canonicalPathin interfaceFileResource
-
path
- Specified by:
pathin interfaceFileResource
-
length
public long length()- Specified by:
lengthin interfaceFileResource
-
lastModified
public long lastModified()- Specified by:
lastModifiedin interfaceFileResource
-
creationTime
-
lastModifiedTime
-
lastAccessTime
-
exists
public boolean exists()- Specified by:
existsin interfaceFileResource
-
canExecute
public boolean canExecute()- Specified by:
canExecutein interfaceFileResource
-
errno
public int errno()- Specified by:
errnoin interfaceFileResource
-
isFile
public boolean isFile()- Specified by:
isFilein interfaceFileResource
-
isDirectory
public boolean isDirectory()- Specified by:
isDirectoryin interfaceFileResource
-
isSymLink
public boolean isSymLink()- Specified by:
isSymLinkin interfaceFileResource
-
canRead
public boolean canRead()- Specified by:
canReadin interfaceFileResource
-
canWrite
public boolean canWrite()- Specified by:
canWritein interfaceFileResource
-
list
- Specified by:
listin interfaceFileResource- See Also:
-
stat
public jnr.posix.FileStat stat()- Specified by:
statin interfaceFileResource
-
lstat
public jnr.posix.FileStat lstat()- Specified by:
lstatin interfaceFileResource
-
toString
-
isNull
public boolean isNull()- Specified by:
isNullin interfaceFileResource- Returns:
- is this a NUL device?
-
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
-
createChannel
- Throws:
IOException
-
unwrap
Description copied from interface:FileResourceUnwrap the resource backend (replacement forFileResource.hackyGetJRubyFile()).- Specified by:
unwrapin interfaceFileResource- Returns:
- backend if supported
-