org.egothor.io
Class FileLocal

java.lang.Object
  extended by org.egothor.io.File
      extended by org.egothor.io.FileLocal

public class FileLocal
extends File

This class is part of the Egothor Project

Author:
Leo Galambos

Constructor Summary
FileLocal(java.lang.String filename)
          Constructor for the FileLocal object
 
Method Summary
 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.
 void delete()
          Deletes the file or the whole directory.
 boolean exists()
          Test whether this file exists on the filesystem.
 java.lang.String getCanonicalPath()
          Return the unique filename of this file.
 java.lang.String getFullPath()
          Return the path of this file.
 java.io.File getJavaFile()
           
 java.lang.String getName()
           
 boolean isDirectory()
           
 long length()
          Return the length of the file denoted by this abstract pathname.
 File[] listFiles()
           
 boolean mkdir()
          Creates the directory.
 void mkparentdirs()
           
 File newFile(java.lang.String relativePath)
          Constructs a sub-file.
 DataOutputStream open4append()
          Description of the Method
 DataInputStream open4gzipread()
          Description of the Method
 DataOutputStream open4gziprewrite()
          Open for write discarding the content of the file.
 DataInputStream open4read(long offset)
          Description of the Method
 DataInputStream open4readseek(long offset)
          Description of the Method
 DataOutputStream open4rewrite()
          Description of the Method
 DataInputOutputStream open4rw(long offset)
          This method returns R/W stream with initial seek at a given offset position.
 void renameTo(File dest)
           
 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

FileLocal

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

Parameters:
filename - Description of the Parameter
Method Detail

length

public long length()
Description copied from class: File
Return the length of the file denoted by this abstract pathname.

Specified by:
length in class File

listFiles

public File[] listFiles()
Specified by:
listFiles in class File

newFile

public File newFile(java.lang.String relativePath)
Description copied from class: File
Constructs a sub-file.

Specified by:
newFile in class File

timestamp

public long timestamp()
Description copied from class: File
Return the timestamp of this file, or -1 when the file does not exist.

Specified by:
timestamp in class File

getFullPath

public java.lang.String getFullPath()
Description copied from class: File
Return the path of this file.

Specified by:
getFullPath in class File

renameTo

public void renameTo(File dest)
              throws java.io.IOException
Specified by:
renameTo in class File
Throws:
java.io.IOException

open4read

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

Specified by:
open4read in class File
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

open4readseek

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

Specified by:
open4readseek in class File
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

mkdir

public boolean mkdir()
              throws java.io.IOException
Description copied from class: File
Creates the directory.

Specified by:
mkdir in class File
Returns:
true iff the directory was created along with all necessary directories
Throws:
java.io.IOException

mkparentdirs

public final void mkparentdirs()
Specified by:
mkparentdirs in class File

open4append

public DataOutputStream open4append()
                             throws java.io.IOException
Description of the Method

Specified by:
open4append in class File
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

open4rewrite

public DataOutputStream open4rewrite()
                              throws java.io.IOException
Description of the Method

Specified by:
open4rewrite in class File
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

open4rw

public DataInputOutputStream open4rw(long offset)
                              throws java.io.IOException
This method returns R/W stream with initial seek at a given offset position. The stream should be used with care as it is not cached at all.

Specified by:
open4rw in class File
Parameters:
offset - the initial offset position
Throws:
java.io.IOException

delete

public void delete()
Deletes the file or the whole directory.

Specified by:
delete in class File
Throws:
java.io.IOException - Description of the Exception

exists

public boolean exists()
Description copied from class: File
Test whether this file exists on the filesystem.

Specified by:
exists in class File

createNewFile

public boolean createNewFile()
                      throws java.io.IOException
Description copied from class: File
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.

Specified by:
createNewFile in class File
Returns:
true iff file does not exist and was successfully created
Throws:
java.io.IOException

open4gzipread

public DataInputStream open4gzipread()
                              throws java.io.IOException
Description copied from class: File
Description of the Method

Specified by:
open4gzipread in class File
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

open4gziprewrite

public DataOutputStream open4gziprewrite()
                                  throws java.io.IOException
Description copied from class: File
Open for write discarding the content of the file.

Specified by:
open4gziprewrite in class File
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

getCanonicalPath

public java.lang.String getCanonicalPath()
                                  throws java.io.IOException
Description copied from class: File
Return the unique filename of this file.

Specified by:
getCanonicalPath in class File
Throws:
java.io.IOException

isDirectory

public boolean isDirectory()
Specified by:
isDirectory in class File

getName

public java.lang.String getName()
Specified by:
getName in class File

getJavaFile

public java.io.File getJavaFile()
Specified by:
getJavaFile in class File