|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jruby.RubyBasicObject
org.jruby.RubyObject
org.jruby.RubyIO
org.jruby.RubyFile
public class RubyFile
Ruby File class equivalent in java.
Nested Class Summary | |
---|---|
static class |
RubyFile.Constants
|
Nested classes/interfaces inherited from class org.jruby.RubyObject |
---|
RubyObject.Data |
Nested classes/interfaces inherited from class org.jruby.RubyBasicObject |
---|
RubyBasicObject.Finalizer |
Field Summary | |
---|---|
static int |
LOCK_EX
|
static int |
LOCK_NB
|
static int |
LOCK_SH
|
static int |
LOCK_UN
|
protected java.lang.String |
path
|
Fields inherited from class org.jruby.RubyIO |
---|
blockingThreads, externalEncoding, internalEncoding, openFile |
Fields inherited from class org.jruby.RubyObject |
---|
OBJECT_ALLOCATOR, REIFYING_OBJECT_ALLOCATOR |
Fields inherited from class org.jruby.RubyBasicObject |
---|
ALL_F, BASICOBJECT_ALLOCATOR, COMPARE_BY_IDENTITY_F, ERR_INSECURE_SET_INST_VAR, FALSE_F, FL_USHIFT, flags, FROZEN_F, metaClass, NEVER, NIL_F, TAINTED_F, UNDEF, UNTRUSTED_F, USER0_F, USER1_F, USER2_F, USER3_F, USER4_F, USER5_F, USER6_F, USER7_F, USER8_F |
Fields inherited from interface org.jruby.runtime.builtin.IRubyObject |
---|
NULL_ARRAY |
Constructor Summary | |
---|---|
RubyFile(Ruby runtime,
RubyClass type)
|
|
RubyFile(Ruby runtime,
java.lang.String path,
java.io.InputStream in)
|
|
RubyFile(Ruby runtime,
java.lang.String path,
java.io.Reader reader)
|
Method Summary | |
---|---|
static IRubyObject |
absolute_path(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
---------------------------------------------------- File::absolute_path File.absolute_path(file_name [, dir_string] ) -> abs_file_name From Ruby 1.9.1 ------------------------------------------------------------------------ Converts a pathname to an absolute pathname. |
IRubyObject |
atime(ThreadContext context)
|
static IRubyObject |
atime(ThreadContext context,
IRubyObject recv,
IRubyObject filename)
|
static IRubyObject |
basename(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
|
static java.lang.String |
canonicalize(java.lang.String path)
|
IRubyObject |
chmod(ThreadContext context,
IRubyObject arg)
|
static IRubyObject |
chmod(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
|
IRubyObject |
chown(ThreadContext context,
IRubyObject arg1,
IRubyObject arg2)
|
static IRubyObject |
chown(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
|
IRubyObject |
close()
Closes all open resources for the IO. |
static RubyClass |
createFileClass(Ruby runtime)
|
IRubyObject |
ctime(ThreadContext context)
|
static IRubyObject |
ctime(ThreadContext context,
IRubyObject recv,
IRubyObject filename)
|
static IRubyObject |
dirname(ThreadContext context,
IRubyObject recv,
IRubyObject arg)
|
static IRubyObject |
expand_path(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
Converts a pathname to an absolute pathname. |
static IRubyObject |
expand_path19(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
|
static java.lang.String |
expandUserPath(ThreadContext context,
java.lang.String path)
This method checks a path, and if it starts with ~, then it expands the path to the absolute path of the user's home directory. |
static IRubyObject |
extname(ThreadContext context,
IRubyObject recv,
IRubyObject arg)
Returns the extension name of the file. |
static JRubyFile |
file(IRubyObject pathOrFile)
Get the fully-qualified JRubyFile object for the path, taking into account the runtime's current directory. |
IRubyObject |
flock(ThreadContext context,
IRubyObject lockingConstant)
|
static IRubyObject |
fnmatch(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
Returns true if path matches against pattern The pattern is not a regular expression; instead it follows rules similar to shell filename globbing. |
static IRubyObject |
ftype(ThreadContext context,
IRubyObject recv,
IRubyObject filename)
|
static RubyString |
get_path(ThreadContext context,
IRubyObject obj)
similar in spirit to rb_get_path from 1.9 source |
static java.util.zip.ZipEntry |
getDirOrFileEntry(java.util.zip.ZipFile zf,
java.lang.String path)
|
org.jcodings.Encoding |
getEncoding()
|
static java.util.zip.ZipEntry |
getFileEntry(java.util.zip.ZipFile zf,
java.lang.String path)
|
java.lang.String |
getPath()
|
IRubyObject |
initialize(IRubyObject[] args,
Block block)
|
IRubyObject |
initialize19(ThreadContext context,
IRubyObject[] args,
Block block)
|
IRubyObject |
inspect()
rb_obj_inspect call-seq: obj.inspect => string Returns a string containing a human-readable representation of obj. |
static RubyString |
join(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
|
IRubyObject |
lchmod(ThreadContext context,
IRubyObject arg)
|
static IRubyObject |
lchmod(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
|
IRubyObject |
lchown(ThreadContext context,
IRubyObject arg1,
IRubyObject arg2)
|
static IRubyObject |
lchown(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
|
static IRubyObject |
link(ThreadContext context,
IRubyObject recv,
IRubyObject from,
IRubyObject to)
|
IRubyObject |
lstat(ThreadContext context)
|
static IRubyObject |
lstat(ThreadContext context,
IRubyObject recv,
IRubyObject filename)
|
IRubyObject |
mtime(ThreadContext context)
|
static IRubyObject |
mtime(ThreadContext context,
IRubyObject recv,
IRubyObject filename)
|
protected void |
openInternal(java.lang.String path,
java.lang.String modeString)
|
protected void |
openInternal(java.lang.String path,
java.lang.String modeString,
ModeFlags modes)
|
IRubyObject |
path(ThreadContext context)
|
static IRubyObject |
path(ThreadContext context,
IRubyObject self,
IRubyObject str)
|
static IRubyObject |
readlink(ThreadContext context,
IRubyObject recv,
IRubyObject path)
|
static IRubyObject |
realdirpath(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
|
static IRubyObject |
realpath(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
|
static IRubyObject |
rename(ThreadContext context,
IRubyObject recv,
IRubyObject oldName,
IRubyObject newName)
|
void |
setEncoding(org.jcodings.Encoding encoding)
|
IRubyObject |
size(ThreadContext context)
|
static RubyArray |
split(ThreadContext context,
IRubyObject recv,
IRubyObject arg)
|
static java.lang.String[] |
splitURI(java.lang.String path)
|
IRubyObject |
stat(ThreadContext context)
|
static IRubyObject |
stat(ThreadContext context,
IRubyObject recv,
IRubyObject filename)
|
static IRubyObject |
symlink(ThreadContext context,
IRubyObject recv,
IRubyObject from,
IRubyObject to)
|
protected void |
sysopenInternal(java.lang.String path,
ModeFlags modes,
int perm)
|
java.lang.String |
toString()
The default toString method is just a wrapper that calls the Ruby "to_s" method. |
IRubyObject |
truncate(ThreadContext context,
IRubyObject arg)
|
static IRubyObject |
truncate(ThreadContext context,
IRubyObject recv,
IRubyObject arg1,
IRubyObject arg2)
|
static IRubyObject |
truncate19(ThreadContext context,
IRubyObject recv,
IRubyObject arg1,
IRubyObject arg2)
|
static IRubyObject |
umask(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
|
static IRubyObject |
unlink(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
|
static IRubyObject |
utime(ThreadContext context,
IRubyObject recv,
IRubyObject[] args)
|
Methods inherited from class org.jruby.RubyObject |
---|
attachToObjectSpace, callInit, callInit, callInit, callInit, callInit, convertToType, createObjectClass, eqlInternal, equalInternal, equals, hashCode, initialize, op_eqq, puts, specificEval |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int LOCK_SH
public static final int LOCK_EX
public static final int LOCK_NB
public static final int LOCK_UN
protected java.lang.String path
Constructor Detail |
---|
public RubyFile(Ruby runtime, RubyClass type)
public RubyFile(Ruby runtime, java.lang.String path, java.io.Reader reader)
public RubyFile(Ruby runtime, java.lang.String path, java.io.InputStream in)
Method Detail |
---|
public org.jcodings.Encoding getEncoding()
getEncoding
in interface EncodingCapable
public void setEncoding(org.jcodings.Encoding encoding)
setEncoding
in interface EncodingCapable
public java.lang.String getPath()
public static RubyClass createFileClass(Ruby runtime)
public IRubyObject close()
RubyIO
Closes all open resources for the IO. It also removes it from our magical all open file descriptor pool.
close
in class RubyIO
public IRubyObject flock(ThreadContext context, IRubyObject lockingConstant)
public IRubyObject initialize(IRubyObject[] args, Block block)
initialize
in class RubyIO
public IRubyObject initialize19(ThreadContext context, IRubyObject[] args, Block block)
protected void sysopenInternal(java.lang.String path, ModeFlags modes, int perm) throws InvalidValueException
InvalidValueException
protected void openInternal(java.lang.String path, java.lang.String modeString, ModeFlags modes) throws InvalidValueException
InvalidValueException
protected void openInternal(java.lang.String path, java.lang.String modeString) throws InvalidValueException
InvalidValueException
public IRubyObject chmod(ThreadContext context, IRubyObject arg)
public IRubyObject chown(ThreadContext context, IRubyObject arg1, IRubyObject arg2)
public IRubyObject atime(ThreadContext context)
public IRubyObject ctime(ThreadContext context)
public IRubyObject lchmod(ThreadContext context, IRubyObject arg)
public IRubyObject lchown(ThreadContext context, IRubyObject arg1, IRubyObject arg2)
public IRubyObject lstat(ThreadContext context)
public IRubyObject mtime(ThreadContext context)
public static IRubyObject path(ThreadContext context, IRubyObject self, IRubyObject str)
public static RubyString get_path(ThreadContext context, IRubyObject obj)
context
- obj
-
public static JRubyFile file(IRubyObject pathOrFile)
public IRubyObject path(ThreadContext context)
public IRubyObject stat(ThreadContext context)
stat
in class RubyIO
public IRubyObject truncate(ThreadContext context, IRubyObject arg)
public java.lang.String toString()
RubyObject
toString
in class RubyIO
public IRubyObject inspect()
RubyBasicObject
to_s
method to
generate the string.
[ 1, 2, 3..4, 'five' ].inspect #=> "[1, 2, 3..4, \"five\"]"
Time.new.inspect #=> "Wed Apr 09 08:54:39 CDT 2003"
inspect
in interface IRubyObject
inspect
in class RubyBasicObject
public static IRubyObject basename(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject chmod(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject chown(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject dirname(ThreadContext context, IRubyObject recv, IRubyObject arg)
public static IRubyObject extname(ThreadContext context, IRubyObject recv, IRubyObject arg)
recv
- arg
- Path to get extension name of
public static IRubyObject expand_path(ThreadContext context, IRubyObject recv, IRubyObject[] args)
recv
- args
-
public static IRubyObject expand_path19(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject absolute_path(ThreadContext context, IRubyObject recv, IRubyObject[] args)
context
- recv
- args
-
public static IRubyObject realdirpath(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject realpath(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static java.lang.String[] splitURI(java.lang.String path)
public static java.lang.String expandUserPath(ThreadContext context, java.lang.String path)
recv
- path
- Path to check
public static java.lang.String canonicalize(java.lang.String path)
public static IRubyObject fnmatch(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject ftype(ThreadContext context, IRubyObject recv, IRubyObject filename)
public static RubyString join(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject lstat(ThreadContext context, IRubyObject recv, IRubyObject filename)
public static IRubyObject stat(ThreadContext context, IRubyObject recv, IRubyObject filename)
public static IRubyObject atime(ThreadContext context, IRubyObject recv, IRubyObject filename)
public static IRubyObject ctime(ThreadContext context, IRubyObject recv, IRubyObject filename)
public static IRubyObject lchmod(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject lchown(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject link(ThreadContext context, IRubyObject recv, IRubyObject from, IRubyObject to)
public static IRubyObject mtime(ThreadContext context, IRubyObject recv, IRubyObject filename)
public static IRubyObject rename(ThreadContext context, IRubyObject recv, IRubyObject oldName, IRubyObject newName)
public static RubyArray split(ThreadContext context, IRubyObject recv, IRubyObject arg)
public static IRubyObject symlink(ThreadContext context, IRubyObject recv, IRubyObject from, IRubyObject to)
public static IRubyObject readlink(ThreadContext context, IRubyObject recv, IRubyObject path)
public static IRubyObject truncate(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2)
public static IRubyObject truncate19(ThreadContext context, IRubyObject recv, IRubyObject arg1, IRubyObject arg2)
public static IRubyObject umask(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject utime(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public static IRubyObject unlink(ThreadContext context, IRubyObject recv, IRubyObject[] args)
public IRubyObject size(ThreadContext context)
public static java.util.zip.ZipEntry getFileEntry(java.util.zip.ZipFile zf, java.lang.String path) throws java.io.IOException
java.io.IOException
public static java.util.zip.ZipEntry getDirOrFileEntry(java.util.zip.ZipFile zf, java.lang.String path) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |