|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.io.IO
org.basex.io.IOFile
public final class IOFile
IO
reference, representing a local file or directory path.
Field Summary |
---|
Fields inherited from class org.basex.io.IO |
---|
BASEXSUFFIX, BLOCKSIZE, BXSSUFFIX, CSVSUFFIX, ENTRIES, FILEPREF, GZSUFFIX, HTMLSUFFIXES, JARSUFFIX, JSONSUFFIX, LOGSUFFIX, MAXATTS, NODEPOWER, NODESIZE, OFFCOMP, OFFNUM, TXTSUFFIXES, XARSUFFIX, XMLSUFFIX, XMLSUFFIXES, XQMSUFFIX, XQSUFFIX, XQSUFFIXES, XSLSUFFIXES, ZIPSUFFIX, ZIPSUFFIXES |
Constructor Summary | |
---|---|
IOFile(java.io.File f)
Constructor. |
|
IOFile(IOFile dir,
java.lang.String n)
Constructor. |
|
IOFile(java.lang.String f)
Constructor. |
|
IOFile(java.lang.String dir,
java.lang.String n)
Constructor. |
Method Summary | |
---|---|
IOFile[] |
children()
Returns the children of the path. |
IOFile[] |
children(java.lang.String regex)
Returns the children of the path that match the specified regular expression. |
void |
copyTo(IOFile trg)
Copies a file to another target. |
boolean |
delete()
Deletes the IO reference. |
StringList |
descendants()
Returns the relative paths of all descendant files. |
IOFile |
dir()
Returns a directory reference. |
java.lang.String |
dirPath()
Returns the directory path. |
boolean |
eq(IO io)
Compares the filename of the specified IO reference. |
boolean |
exists()
Tests if the reference exists. |
java.io.File |
file()
Returns the file reference. |
static IOFile |
get(java.lang.String url)
Normalizes the specified URL and creates a new IOFile instance. |
org.xml.sax.InputSource |
inputSource()
Returns an input source. |
java.io.InputStream |
inputStream()
Returns an input stream. |
boolean |
isDir()
Tests if this is a directory instance. |
static boolean |
isValid(java.lang.String s)
Checks if the specified string is a valid file reference. |
long |
length()
Returns the file length. |
boolean |
md()
Recursively creates the directory. |
IO |
merge(java.lang.String f)
Merges two paths. |
byte[] |
read()
Returns the binary contents. |
static java.lang.String |
regex(java.lang.String glob)
Converts a file filter (glob) to a regular expression. |
static java.lang.String |
regex(java.lang.String glob,
boolean sub)
Converts a file filter (glob) to a regular expression. |
boolean |
rename(IOFile trg)
Renames the file to the specified name. |
javax.xml.transform.stream.StreamSource |
streamSource()
Returns a stream source. |
long |
timeStamp()
Returns the time stamp (modification date) of this file. |
boolean |
touch()
Creates a new instance of this file. |
java.lang.String |
url()
Creates a URL from the specified path. |
void |
write(byte[] c)
Writes the specified byte array. |
void |
write(java.io.InputStream in)
Writes the specified input. |
Methods inherited from class org.basex.io.IO |
---|
dbname, hasSuffix, isArchive, length, name, name, path, string, suffix, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IOFile(java.lang.String f)
f
- file pathpublic IOFile(java.io.File f)
f
- file referencepublic IOFile(java.lang.String dir, java.lang.String n)
dir
- directoryn
- file namepublic IOFile(IOFile dir, java.lang.String n)
dir
- directoryn
- file nameMethod Detail |
---|
public java.io.File file()
public boolean touch()
public byte[] read() throws java.io.IOException
IO
read
in class IO
java.io.IOException
- I/O exceptionpublic boolean exists()
IO
true
for IO instances other than IOFile
.
exists
in class IO
public boolean isDir()
IO
false
for IO instances other than IOFile
.
isDir
in class IO
public long timeStamp()
IO
IOFile
.
timeStamp
in class IO
public long length()
IO
length
in class IO
public org.xml.sax.InputSource inputSource()
IO
inputSource
in class IO
public javax.xml.transform.stream.StreamSource streamSource()
IO
streamSource
in class IO
public java.io.InputStream inputStream() throws java.io.IOException
IO
inputStream
in class IO
java.io.IOException
- I/O exceptionpublic IO merge(java.lang.String f)
IO
IOContent
and
IOStream
instances.
merge
in class IO
f
- name/path to be appended
public boolean md()
public java.lang.String dirPath()
IO
dirPath
in class IO
public IOFile dir()
public IOFile[] children()
public IOFile[] children(java.lang.String regex)
regex
- regular expression pattern
public StringList descendants()
public void write(byte[] c) throws java.io.IOException
c
- contents
java.io.IOException
- I/O exceptionpublic void write(java.io.InputStream in) throws java.io.IOException
in
- input stream
java.io.IOException
- I/O exceptionpublic boolean delete()
public boolean rename(IOFile trg)
trg
- target reference
public void copyTo(IOFile trg) throws java.io.IOException
trg
- target
java.io.IOException
- I/O exceptionpublic boolean eq(IO io)
IO
eq
in class IO
io
- io reference
public java.lang.String url()
IO
IOFile
.
url
in class IO
public static boolean isValid(java.lang.String s)
s
- source
public static java.lang.String regex(java.lang.String glob)
glob
- filter
public static java.lang.String regex(java.lang.String glob, boolean sub)
glob
- filtersub
- accept substring in the result
public static IOFile get(java.lang.String url)
IOFile
instance.
url
- url to be converted
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |