org.egothor.io
Class File

java.lang.Object
  extended by org.egothor.io.File
Direct Known Subclasses:
FileLocal

public abstract class File
extends java.lang.Object

This class is part of the Egothor Project

Author:
Leo Galambos

Constructor Summary
File(java.lang.String filename)
          Constructor for the File object
 
Method Summary
abstract  boolean createNewFile()
          Atomically creates a new, empty file named by this abstract pathname if and only if a file with this name does not yet exist.
abstract  void delete()
          Description of the Method
abstract  boolean exists()
          Test whether this file exists on the filesystem.
abstract  java.lang.String getCanonicalPath()
          Return the unique filename of this file.
abstract  java.lang.String getFullPath()
          Return the path of this file.
abstract  java.io.File getJavaFile()
           
abstract  java.lang.String getName()
           
abstract  boolean isDirectory()
           
abstract  long length()
          Return the length of the file denoted by this abstract pathname.
abstract  File[] listFiles()
           
abstract  boolean mkdir()
          Creates the directory.
abstract  void mkparentdirs()
           
abstract  File newFile(java.lang.String relativePath)
          Constructs a sub-file.
abstract  DataOutputStream open4append()
          Open for write in the append mode.
abstract  DataInputStream open4gzipread()
          Description of the Method
abstract  DataOutputStream open4gziprewrite()
          Open for write discarding the content of the file.
abstract  DataInputStream open4read(long offset)
          Description of the Method
abstract  DataInputStream open4readseek(long offset)
          Description of the Method
abstract  DataOutputStream open4rewrite()
          Open for write discarding the content of the file.
abstract  DataInputOutputStream open4rw(long offset)
           
abstract  void renameTo(File dest)
           
abstract  long timestamp()
          Return the timestamp of this file, or -1 when the file does not exist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

File

public File(java.lang.String filename)
Constructor for the File object

Parameters:
filename - Description of the Parameter
Method Detail

timestamp

public abstract long timestamp()
Return the timestamp of this file, or -1 when the file does not exist.


getFullPath

public abstract java.lang.String getFullPath()
Return the path of this file.


getCanonicalPath

public abstract java.lang.String getCanonicalPath()
                                           throws java.io.IOException
Return the unique filename of this file.

Throws:
java.io.IOException

renameTo

public abstract void renameTo(File dest)
                       throws java.io.IOException
Throws:
java.io.IOException

listFiles

public abstract File[] listFiles()

newFile

public abstract File newFile(java.lang.String relativePath)
Constructs a sub-file.


length

public abstract long length()
Return the length of the file denoted by this abstract pathname.


exists

public abstract boolean exists()
Test whether this file exists on the filesystem.


createNewFile

public abstract boolean createNewFile()
                               throws java.io.IOException
Atomically creates a new, empty file named by this abstract pathname if and only if a file with this name does not yet exist. The check for the existence of the file and the creation of the file if it does not exist are a single operation that is atomic with respect to all other filesystem activities that might affect the file.

Returns:
true iff file does not exist and was successfully created
Throws:
java.io.IOException

mkdir

public abstract boolean mkdir()
                       throws java.io.IOException
Creates the directory.

Returns:
true iff the directory was created along with all necessary directories
Throws:
java.io.IOException

open4read

public abstract DataInputStream open4read(long offset)
                                   throws java.io.IOException
Description of the Method

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

open4gzipread

public abstract DataInputStream open4gzipread()
                                       throws java.io.IOException
Description of the Method

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

open4append

public abstract DataOutputStream open4append()
                                      throws java.io.IOException
Open for write in the append mode.

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

open4rewrite

public abstract DataOutputStream open4rewrite()
                                       throws java.io.IOException
Open for write discarding the content of the file.

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

open4gziprewrite

public abstract DataOutputStream open4gziprewrite()
                                           throws java.io.IOException
Open for write discarding the content of the file.

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

open4readseek

public abstract DataInputStream open4readseek(long offset)
                                       throws java.io.IOException
Description of the Method

Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

open4rw

public abstract DataInputOutputStream open4rw(long offset)
                                       throws java.io.IOException
Throws:
java.io.IOException

delete

public abstract void delete()
Description of the Method


isDirectory

public abstract boolean isDirectory()

getName

public abstract java.lang.String getName()

getJavaFile

public abstract java.io.File getJavaFile()

mkparentdirs

public abstract void mkparentdirs()