|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.io.IO
public abstract class IO
BaseX file representation, pointing to a local or remote file or byte array contents.
Field Summary | |
---|---|
static java.lang.String |
BASEXSUFFIX
BaseX Suffix. |
static double |
BLOCKFILL
Fill Factor (greater than 0.0, maximum 1.0). |
static int |
BLOCKSIZE
Block size. |
static IO |
DUMMY
Return IO dummy instance. |
static java.lang.String |
GZSUFFIX
GZIP Suffix. |
static int |
MAXHEIGHT
Maximum Tree depth. |
static int |
NODEPOWER
Table NodeSize Power. |
static java.lang.String |
TXTSUFFIX
Text Suffix. |
static java.lang.String |
XMLSUFFIX
XML Suffix. |
static java.lang.String |
XQSUFFIX
XQuery Suffix. |
static java.lang.String |
ZIPSUFFIX
ZIP Suffix. |
Method Summary | |
---|---|
abstract BufferInput |
buffer()
Returns a buffered reader for the file. |
abstract void |
cache()
Caches the contents. |
IO[] |
children()
Returns the children of a document. |
byte[] |
content()
Returns the contents. |
long |
date()
Returns the modification date of this file. |
static boolean |
dbdelete(java.lang.String db,
java.lang.String pat)
Recursively deletes a directory. |
static java.io.File |
dbfile(java.lang.String db,
java.lang.String file)
Adds the database suffix to the specified filename and creates a file instance. |
java.lang.String |
dbname()
Chops the path and the XML suffix of the specified filename. |
static java.io.File |
dbpath(java.lang.String db)
Returns a file instance for the current database path. |
boolean |
delete()
Chops the path and the XML suffix of the specified filename. |
boolean |
eq(IO io)
Compares the filename of the specified IO reference. |
boolean |
exists()
Verifies if the file exists. |
static IO |
get(java.lang.String s)
Constructor. |
java.lang.String |
getDir()
Returns the directory of this path. |
abstract org.xml.sax.InputSource |
inputSource()
Returns the next input source. |
boolean |
isDir()
Returns if this is a directory instance. |
boolean |
isSymLink()
Returns if this is a directory instance. |
static boolean |
isSymlink(java.io.File f)
Determines if the specified file is a symbolic link. |
long |
length()
Returns the file length. |
IO |
merge(IO f)
Merges two filenames. |
boolean |
more()
Checks if more input streams are found. |
java.lang.String |
name()
Chops the path and the XML suffix of the specified filename. |
java.lang.String |
path()
Chops the path and the XML suffix of the specified filename. |
void |
suffix(java.lang.String suf)
Sets the specified suffix if none exists. |
java.lang.String |
toString()
|
static java.lang.String |
url(java.lang.String path)
Creates a URL from the specified path. |
static boolean |
valid(java.lang.String fn)
Checks if the specified filename is valid; allows only letters, digits and some special characters. |
void |
write(byte[] c)
Writes the specified file contents. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final IO DUMMY
public static final java.lang.String BASEXSUFFIX
public static final java.lang.String XQSUFFIX
public static final java.lang.String TXTSUFFIX
public static final java.lang.String XMLSUFFIX
public static final java.lang.String ZIPSUFFIX
public static final java.lang.String GZSUFFIX
public static final int BLOCKSIZE
public static final int NODEPOWER
public static final double BLOCKFILL
public static final int MAXHEIGHT
Method Detail |
---|
public static IO get(java.lang.String s)
s
- source
public final byte[] content() throws java.io.IOException
java.io.IOException
- I/O exceptionpublic abstract void cache() throws java.io.IOException
java.io.IOException
- I/O exceptionpublic boolean exists()
public boolean isDir()
public boolean isSymLink() throws java.io.IOException
java.io.IOException
- I/O exceptionpublic final java.lang.String getDir()
public long date()
public long length()
public boolean more() throws java.io.IOException
java.io.IOException
- I/O exceptionpublic abstract org.xml.sax.InputSource inputSource()
public abstract BufferInput buffer() throws java.io.IOException
java.io.IOException
- I/O exceptionpublic IO merge(IO f)
f
- filename of the file
public final void suffix(java.lang.String suf)
suf
- suffixpublic final java.lang.String dbname()
public final java.lang.String name()
public final java.lang.String path()
public IO[] children()
public void write(byte[] c) throws java.io.IOException
c
- contents
java.io.IOException
- I/O exceptionpublic boolean delete()
public final boolean eq(IO io)
io
- io reference
public final java.lang.String toString()
toString
in class java.lang.Object
public static java.io.File dbfile(java.lang.String db, java.lang.String file)
db
- name of the databasefile
- filename
public static java.io.File dbpath(java.lang.String db)
db
- name of the database
public static boolean dbdelete(java.lang.String db, java.lang.String pat)
db
- database to deletepat
- file pattern
public static boolean valid(java.lang.String fn)
fn
- filename
public static final java.lang.String url(java.lang.String path)
path
- path to be converted
public static boolean isSymlink(java.io.File f) throws java.io.IOException
f
- file to be tested.
java.io.IOException
- I/O exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |