Package org.jruby.util
Class URLResource
java.lang.Object
org.jruby.util.URLResource
- All Implemented Interfaces:
FileResource
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancanRead()booleancanWrite()static FileResourcestatic FileResourcecreateClassloaderURI(Ruby runtime, String pathname, boolean asFile) booleaninterrno()booleanexists()static URLgetResourceURL(Ruby runtime, String location) inthashCode()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, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jruby.util.FileResource
hackyGetJRubyFile, inputStream, isNull, openChannel
-
Field Details
-
URI
- See Also:
-
CLASSLOADER
- See Also:
-
URI_CLASSLOADER
- See Also:
-
-
Method Details
-
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
-
length
public long length()- Specified by:
lengthin interfaceFileResource
-
canRead
public boolean canRead()- Specified by:
canReadin interfaceFileResource
-
canWrite
public boolean canWrite()- Specified by:
canWritein interfaceFileResource
-
canExecute
public boolean canExecute()- Specified by:
canExecutein interfaceFileResource
-
list
- Specified by:
listin interfaceFileResource- See Also:
-
isSymLink
public boolean isSymLink()- Specified by:
isSymLinkin interfaceFileResource
-
lastModified
public long lastModified()- Specified by:
lastModifiedin interfaceFileResource
-
lastModifiedTime
-
lastAccessTime
-
creationTime
-
errno
public int errno()- Specified by:
errnoin interfaceFileResource
-
stat
public jnr.posix.FileStat stat()- Specified by:
statin interfaceFileResource
-
lstat
public jnr.posix.FileStat lstat()- Specified by:
lstatin interfaceFileResource
-
unwrap
Description copied from interface:FileResourceUnwrap the resource backend (replacement forFileResource.hackyGetJRubyFile()).- Specified by:
unwrapin interfaceFileResource- Type Parameters:
T-- Parameters:
type-- Returns:
- backend if supported
- Throws:
UnsupportedOperationException
-
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
-
equals
-
hashCode
public int hashCode() -
toString
-
createClassloaderURI
-
create
-
getResourceURL
-