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

File reference, wrapped into an IO representation.

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

Field Summary
 
Fields inherited from class org.basex.io.IO
BASEXSUFFIX, BLOCKFILL, BLOCKSIZE, DUMMY, GZSUFFIX, MAXHEIGHT, NODEPOWER, NUMOFF, XMLSUFFIX, XQSUFFIX, ZIPSUFFIX
 
Constructor Summary
IOFile(File f)
          Constructor.
IOFile(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.
 String dir()
          Returns the directory.
 boolean exists()
          Verifies if the file exists.
static String file(String url)
          Creates a file path from the specified URL.
 InputSource inputSource()
          Returns the next input source.
 boolean isDir()
          Returns if this is a directory instance.
 long length()
          Returns the file length.
 boolean md()
          Creates the directory.
 IO merge(String f)
          Merges two filenames.
 boolean more()
          Checks if more input streams are found.
 String url()
          Creates a URL from the specified path.
 void write(byte[] c)
          Writes the specified file contents.
 
Methods inherited from class org.basex.io.IO
content, dbname, eq, get, getDir, name, path, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IOFile

public IOFile(String f)
Constructor.

Parameters:
f - file path

IOFile

public IOFile(File f)
Constructor.

Parameters:
f - file reference
Method Detail

cache

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

Specified by:
cache in class IO
Throws:
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

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 IOException
Description copied from class: IO
Checks if more input streams are found.

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

inputSource

public 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 IOException
Description copied from class: IO
Returns a buffered reader for the file.

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

merge

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

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

md

public boolean md()
Description copied from class: IO
Creates the directory.

Overrides:
md in class IO
Returns:
contents

dir

public String dir()
Description copied from class: IO
Returns the directory.

Overrides:
dir in class IO
Returns:
chopped filename

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 IOException
Description copied from class: IO
Writes the specified file contents.

Overrides:
write in class IO
Parameters:
c - contents
Throws:
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

url

public String url()
Description copied from class: IO
Creates a URL from the specified path.

Overrides:
url in class IO
Returns:
URL

file

public static String file(String url)
Creates a file path from the specified URL.

Parameters:
url - url to be converted
Returns:
file path