All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class spec.io.File

spec.io.File

public class File
This class extends the java.io.File and provides some extra functionality. File object maintains a static table of files called the Table of existing files. The files listed in the TableOfExisting files are loaded from the local disk. All the other files are loaded over the network.


Constructor Index

 o File(File, String)
Overloaded constructor which takes the directory in the File object format and a name of the file.
 o File(String)
Constructor.
 o File(String, String)
Overloaded constructor which takes the path and the files name to load the file

Method Index

 o canRead()
Checks whether the given file is readable
 o canWrite()
Checks whether the given file is writablle or not
 o delete()
Deletes the file specified by this object.
 o equals(Object)
Compares this object against the specified object.
 o exists()
Checks whether the given file name exists or not
 o getAbsolutePath()
returns tha absolutePath of the file Dir + name
 o getName()
returns the name of the file
 o getParent()
returns the Parent directory name
 o getPath()
returns the path of the file
 o hashCode()
Computes a hashcode for the file.
 o isDirectory()
Checks whether the given file name is directory or not
 o isFile()
Checks whether the given file name is a file or directory The functionality is modified to return whether the file name is classes.zip or not
 o lastModified()
Returns the date of last modification
 o length()
Returns the length of the file
 o list()
Returns a list of the files in the directory specified by this File object
 o list(FilenameFilter)
Returns a list of the files in the directory specified by this File that satisfy the specified filter.
 o mkdir()
Creates a new directory
 o mkdirs()
Creates a directory whose pathname is specified by this File object, including any necessary parent directories.
 o renameTo(File)
Renames the file
 o toString()
Returns a string representation of this object.

Constructors

 o File
 public File(String path)
Constructor.

Parameters:
Path - of the file (includes the file name also)
 o File
 public File(String path,
             String name)
Overloaded constructor which takes the path and the files name to load the file

Parameters:
path - Directory of the file
name - file name
 o File
 public File(File dir,
             String name)
Overloaded constructor which takes the directory in the File object format and a name of the file.

Parameters:
dir - Directory of the file in the File object format
name - file name

Methods

 o getName
 public String getName()
returns the name of the file

Returns:
name of file
 o getPath
 public String getPath()
returns the path of the file

 o getAbsolutePath
 public String getAbsolutePath()
returns tha absolutePath of the file Dir + name

 o getParent
 public String getParent()
returns the Parent directory name

 o exists
 public boolean exists()
Checks whether the given file name exists or not

 o canWrite
 public boolean canWrite()
Checks whether the given file is writablle or not

 o canRead
 public boolean canRead()
Checks whether the given file is readable

 o isFile
 public boolean isFile()
Checks whether the given file name is a file or directory The functionality is modified to return whether the file name is classes.zip or not

 o isDirectory
 public boolean isDirectory()
Checks whether the given file name is directory or not

 o lastModified
 public long lastModified()
Returns the date of last modification

 o length
 public long length()
Returns the length of the file

 o mkdir
 public boolean mkdir()
Creates a new directory

 o renameTo
 public boolean renameTo(File dest)
Renames the file

 o mkdirs
 public boolean mkdirs()
Creates a directory whose pathname is specified by this File object, including any necessary parent directories.

 o list
 public String[] list()
Returns a list of the files in the directory specified by this File object

 o list
 public String[] list(FilenameFilter filter)
Returns a list of the files in the directory specified by this File that satisfy the specified filter.

 o delete
 public boolean delete()
Deletes the file specified by this object.

 o hashCode
 public int hashCode()
Computes a hashcode for the file.

 o equals
 public boolean equals(Object obj)
Compares this object against the specified object.

 o toString
 public String toString()
Returns a string representation of this object.


All Packages  Class Hierarchy  This Package  Previous  Next  Index