public final class RubyDir extends RubyEnumerable<java.lang.String>
RubyDir
implements parts of the methods refer to the Dir class of
Ruby.Modifier and Type | Method and Description |
---|---|
static boolean |
delete(java.lang.String path)
Deletes a directory.
|
RubyEnumerator<java.lang.String> |
each()
Creates a
RubyEnumerator of entries of this RubyDir . |
RubyDir |
each(Block<? super java.lang.String> block)
Yields each entry to the given block.
|
static RubyArray<java.lang.String> |
entries(java.lang.String path)
Puts entries of a folder into a
RubyArray . |
static boolean |
existsʔ(java.lang.String path)
Checks if the file is a directory.
|
static boolean |
existʔ(java.lang.String path)
Checks if the file is a directory.
|
static RubyEnumerator<java.lang.String> |
foreach(java.lang.String path)
Creates a
RubyEnumerator of entries of the given path. |
protected java.lang.Iterable<java.lang.String> |
getIterable()
Returns an Iterable of elements.
|
static RubyArray<java.lang.String> |
glob(java.lang.String pattern)
Retrieves all paths of files of given url pattern.
|
static java.lang.String |
home()
Finds the home directory of current user.
|
static boolean |
mkdir(java.lang.String path)
Creates a directory.
|
static RubyDir |
open(java.lang.String path)
Creates a
RubyDir by given path. |
java.lang.String |
path()
Returns the path of this
RubyDir . |
int |
pos()
Returns the current position of entries.
|
int |
pos(int position)
Sets the current position of entries.
|
static java.lang.String |
pwd()
Returns the present working directory.
|
java.lang.String |
read()
Returns the next of entries.
|
RubyDir |
rewind()
Sets 0 to the position of entries.
|
RubyDir |
seek(int position)
Returns a
RubyDir that entries is set to the given position. |
int |
tell()
Returns the current position of entries.
|
java.lang.String |
toString() |
allʔ, allʔ, anyʔ, anyʔ, chunk, chunk, collect, collect, collect, collectConcat, collectConcat, count, count, cycle, cycle, cycle, cycle, detect, detect, drop, dropWhile, dropWhile, eachCons, eachCons, eachEntry, eachEntry, eachSlice, eachSlice, eachWithIndex, eachWithIndex, eachWithObject, eachWithObject, entries, find, find, findAll, findAll, findIndex, findIndex, findIndex, first, first, flatMap, flatMap, grep, grep, grep, groupBy, groupBy, groupBy, includeʔ, inject, inject, inject, inject, iterator, lazy, map, map, map, max, max, maxBy, maxBy, maxBy, maxBy, memberʔ, min, min, minBy, minBy, minBy, minBy, minmax, minmax, minmaxBy, minmaxBy, minmaxBy, minmaxBy, noneʔ, noneʔ, oneʔ, oneʔ, partition, partition, reduce, reduce, reduce, reduce, reject, reject, reverseEach, reverseEach, select, select, sliceBefore, sliceBefore, sort, sortBy, sortBy, sortBy, sortBy, sortBy, take, takeWhile, takeWhile, toA, zip, zip, zip
protected java.lang.Iterable<java.lang.String> getIterable()
RubyEnumerable
getIterable
in class RubyEnumerable<java.lang.String>
public static RubyDir open(java.lang.String path)
RubyDir
by given path.path
- of a fileRubyDir
java.lang.IllegalArgumentException
- if no such file or directorypublic static boolean delete(java.lang.String path)
path
- of a filepublic static RubyArray<java.lang.String> entries(java.lang.String path)
RubyArray
.path
- of a fileRubyArray
public static boolean existsʔ(java.lang.String path)
path
- of a filepublic static boolean existʔ(java.lang.String path)
path
- of a filepublic static RubyEnumerator<java.lang.String> foreach(java.lang.String path)
RubyEnumerator
of entries of the given path.path
- of a fileRubyEnumerator
public static RubyArray<java.lang.String> glob(java.lang.String pattern)
pattern
- of target filesRubyArray
public static java.lang.String home()
public static boolean mkdir(java.lang.String path)
path
- of a filepublic static java.lang.String pwd()
public RubyEnumerator<java.lang.String> each()
RubyEnumerator
of entries of this RubyDir
.each
in interface Ruby.Enumerable<java.lang.String>
each
in interface RubyContract.Enumerable<java.lang.String,Ruby.Enumerator<?>,RubyArray<?>>
each
in class RubyEnumerable<java.lang.String>
RubyEnumerator
public RubyDir each(Block<? super java.lang.String> block)
each
in interface Ruby.Enumerable<java.lang.String>
each
in interface RubyContract.Enumerable<java.lang.String,Ruby.Enumerator<?>,RubyArray<?>>
each
in class RubyEnumerable<java.lang.String>
block
- to yield entriesRubyDir
public java.lang.String path()
RubyDir
.RubyDir
public int pos()
public int pos(int position)
position
- the current index of entries to be setpublic java.lang.String read()
public RubyDir rewind()
public RubyDir seek(int position)
RubyDir
that entries is set to the given position.position
- to be searchedRubyDir
that entries is set to the given positionpublic int tell()
public java.lang.String toString()
toString
in class RubyEnumerable<java.lang.String>