org.basex.io
Class IOFile

java.lang.Object
  extended by org.basex.io.IO
      extended by org.basex.io.IOFile

public final class IOFile
extends IO

BaseX file representation, pointing to a local or remote file or byte array contents.

Author:
Workgroup DBIS, University of Konstanz 2005-08, ISC License, Christian Gruen

Field Summary
 
Fields inherited from class org.basex.io.IO
BASEXSUFFIX, BLOCKFILL, BLOCKSIZE, DUMMY, GZSUFFIX, MAXHEIGHT, NODEPOWER, TXTSUFFIX, XMLSUFFIX, XQSUFFIX, ZIPSUFFIX
 
Constructor Summary
IOFile(java.lang.String f)
          Constructor.
 
Method Summary
 BufferInput buffer()
          Returns a buffered reader for the file.
 void cache()
          Caches the contents.
 IO[] children()
          Returns the children of a document.
 long date()
          Returns the modification date of this file.
 boolean delete()
          Chops the path and the XML suffix of the specified filename.
 boolean exists()
          Verifies if the file exists.
 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.
 long length()
          Returns the file length.
 IO merge(IO f)
          Merges two filenames.
 boolean more()
          Checks if more input streams are found.
 void write(byte[] c)
          Writes the specified file contents.
 
Methods inherited from class org.basex.io.IO
content, dbdelete, dbfile, dbname, dbpath, eq, get, getDir, isSymlink, name, path, suffix, toString, url, valid
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IOFile

public IOFile(java.lang.String f)
Constructor.

Parameters:
f - file path
Method Detail

cache

public void cache()
           throws java.io.IOException
Description copied from class: IO
Caches the contents.

Specified by:
cache in class IO
Throws:
java.io.IOException - I/O exception

exists

public boolean exists()
Description copied from class: IO
Verifies if the file exists.

Overrides:
exists in class IO
Returns:
result of check

isDir

public boolean isDir()
Description copied from class: IO
Returns if this is a directory instance.

Overrides:
isDir in class IO
Returns:
result of check

isSymLink

public boolean isSymLink()
                  throws java.io.IOException
Description copied from class: IO
Returns if this is a directory instance.

Overrides:
isSymLink in class IO
Returns:
result of check
Throws:
java.io.IOException - I/O exception

date

public long date()
Description copied from class: IO
Returns the modification date of this file.

Overrides:
date in class IO
Returns:
modification date

length

public long length()
Description copied from class: IO
Returns the file length.

Overrides:
length in class IO
Returns:
file length

more

public boolean more()
             throws java.io.IOException
Description copied from class: IO
Checks if more input streams are found.

Overrides:
more in class IO
Returns:
result of check
Throws:
java.io.IOException - I/O exception

inputSource

public org.xml.sax.InputSource inputSource()
Description copied from class: IO
Returns the next input source.

Specified by:
inputSource in class IO
Returns:
input source

buffer

public BufferInput buffer()
                   throws java.io.IOException
Description copied from class: IO
Returns a buffered reader for the file.

Specified by:
buffer in class IO
Returns:
buffered reader
Throws:
java.io.IOException - I/O exception

merge

public IO merge(IO f)
Description copied from class: IO
Merges two filenames.

Overrides:
merge in class IO
Parameters:
f - filename of the file
Returns:
contents

children

public IO[] children()
Description copied from class: IO
Returns the children of a document.

Overrides:
children in class IO
Returns:
chopped filename

write

public void write(byte[] c)
           throws java.io.IOException
Description copied from class: IO
Writes the specified file contents.

Overrides:
write in class IO
Parameters:
c - contents
Throws:
java.io.IOException - I/O exception

delete

public boolean delete()
Description copied from class: IO
Chops the path and the XML suffix of the specified filename.

Overrides:
delete in class IO
Returns:
chopped filename