public class URLResource extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CLASSLOADER |
static String |
URI |
static String |
URI_CLASSLOADER |
Modifier and Type | Method and Description |
---|---|
String |
absolutePath() |
boolean |
canExecute() |
String |
canonicalPath() |
boolean |
canRead() |
boolean |
canWrite() |
static FileResource |
create(ClassLoader cl,
String pathname) |
static FileResource |
create(Ruby runtime,
String pathname) |
static FileResource |
createClassloaderURI(Ruby runtime,
String pathname) |
int |
errno() |
boolean |
exists() |
static URL |
getResourceURL(Ruby runtime,
String location) |
JRubyFile |
hackyGetJRubyFile() |
InputStream |
inputStream()
Opens a new input stream to read the contents of a resource and returns it.
|
boolean |
isDirectory() |
boolean |
isFile() |
boolean |
isSymLink() |
long |
lastModified() |
long |
length() |
String[] |
list() |
jnr.posix.FileStat |
lstat() |
ChannelDescriptor |
openDescriptor(ModeFlags flags,
int perm) |
jnr.posix.FileStat |
stat() |
public static String URI
public static String CLASSLOADER
public static String URI_CLASSLOADER
public String absolutePath()
public String canonicalPath()
public boolean exists()
public boolean isDirectory()
public boolean isFile()
public long lastModified()
public long length()
public boolean canRead()
public boolean canWrite()
public String[] list()
File.list()
public boolean isSymLink()
public jnr.posix.FileStat stat()
public jnr.posix.FileStat lstat()
public JRubyFile hackyGetJRubyFile()
public ChannelDescriptor openDescriptor(ModeFlags flags, int perm) throws ResourceException
ResourceException
public static FileResource create(ClassLoader cl, String pathname)
public static FileResource createClassloaderURI(Ruby runtime, String pathname)
public static FileResource create(Ruby runtime, String pathname)
public boolean canExecute()
canExecute
in interface FileResource
public int errno()
errno
in interface FileResource
public InputStream inputStream() throws ResourceException
FileResource
inputStream
in interface FileResource
ResourceException
- is the file does not exists or if the resource is a directoryCopyright © 2001-2016 JRuby. All Rights Reserved.