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.
-
File(File, String)
- Overloaded constructor which takes the directory in the File object format
and a name of the file.
-
File(String)
- Constructor.
-
File(String, String)
- Overloaded constructor which takes the path and the files name to load the
file
-
canRead()
- Checks whether the given file is readable
-
canWrite()
- Checks whether the given file is writablle or not
-
delete()
- Deletes the file specified by this object.
-
equals(Object)
- Compares this object against the specified object.
-
exists()
- Checks whether the given file name exists or not
-
getAbsolutePath()
- returns tha absolutePath of the file Dir + name
-
getName()
- returns the name of the file
-
getParent()
- returns the Parent directory name
-
getPath()
- returns the path of the file
-
hashCode()
- Computes a hashcode for the file.
-
isDirectory()
- Checks whether the given file name is directory or not
-
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
-
lastModified()
- Returns the date of last modification
-
length()
- Returns the length of the file
-
list()
- Returns a list of the files in the directory specified by this File object
-
list(FilenameFilter)
- Returns a list of the files in the directory specified by this File that
satisfy the specified filter.
-
mkdir()
- Creates a new directory
-
mkdirs()
- Creates a directory whose pathname is specified by this File object,
including any necessary parent directories.
-
renameTo(File)
- Renames the file
-
toString()
- Returns a string representation of this object.
File
public File(String path)
- Constructor.
- Parameters:
- Path - of the file (includes the file name also)
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
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
getName
public String getName()
- returns the name of the file
- Returns:
- name of file
getPath
public String getPath()
- returns the path of the file
getAbsolutePath
public String getAbsolutePath()
- returns tha absolutePath of the file Dir + name
getParent
public String getParent()
- returns the Parent directory name
exists
public boolean exists()
- Checks whether the given file name exists or not
canWrite
public boolean canWrite()
- Checks whether the given file is writablle or not
canRead
public boolean canRead()
- Checks whether the given file is readable
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
isDirectory
public boolean isDirectory()
- Checks whether the given file name is directory or not
lastModified
public long lastModified()
- Returns the date of last modification
length
public long length()
- Returns the length of the file
mkdir
public boolean mkdir()
- Creates a new directory
renameTo
public boolean renameTo(File dest)
- Renames the file
mkdirs
public boolean mkdirs()
- Creates a directory whose pathname is specified by this File object,
including any necessary parent directories.
list
public String[] list()
- Returns a list of the files in the directory specified by this File object
list
public String[] list(FilenameFilter filter)
- Returns a list of the files in the directory specified by this File that
satisfy the specified filter.
delete
public boolean delete()
- Deletes the file specified by this object.
hashCode
public int hashCode()
- Computes a hashcode for the file.
equals
public boolean equals(Object obj)
- Compares this object against the specified object.
toString
public String toString()
- Returns a string representation of this object.
All Packages Class Hierarchy This Package Previous Next Index