com.sun.mail.mbox
Interface FileInterface

All Known Subinterfaces:
InboxFile, MailFile
All Known Implementing Classes:
UNIXFolder, UNIXInbox

public interface FileInterface


Method Summary
 boolean canRead()
          Returns a boolean indicating whether or not a readable file exists.
 boolean canWrite()
          Returns a boolean indicating whether or not a writable file exists.
 boolean delete()
          Deletes the specified file.
 boolean exists()
          Returns a boolean indicating whether or not a file exists.
 java.lang.String getAbsolutePath()
          Gets the absolute path of the file.
 java.lang.String getName()
          Gets the name of the file.
 java.lang.String getParent()
          Gets the name of the parent directory.
 java.lang.String getPath()
          Gets the path of the file.
 boolean isAbsolute()
          Returns a boolean indicating whether the file name is absolute.
 boolean isDirectory()
          Returns a boolean indicating whether or not a directory file exists.
 boolean isFile()
          Returns a boolean indicating whether or not a normal file exists.
 long lastModified()
          Returns the last modification time.
 long length()
          Returns the length of the file.
 java.lang.String[] list()
          Lists the files in a directory.
 java.lang.String[] list(java.io.FilenameFilter filter)
          Uses the specified filter to list files in a directory.
 boolean mkdir()
          Creates a directory and returns a boolean indicating the success of the creation.
 boolean mkdirs()
          Creates all directories in this path.
 boolean renameTo(java.io.File dest)
          Renames a file and returns a boolean indicating whether or not this method was successful.
 

Method Detail

getName

java.lang.String getName()
Gets the name of the file. This method does not include the directory.

Returns:
the file name.

getPath

java.lang.String getPath()
Gets the path of the file.

Returns:
the file path.

getAbsolutePath

java.lang.String getAbsolutePath()
Gets the absolute path of the file.

Returns:
the absolute file path.

getParent

java.lang.String getParent()
Gets the name of the parent directory.

Returns:
the parent directory, or null if one is not found.

exists

boolean exists()
Returns a boolean indicating whether or not a file exists.


canWrite

boolean canWrite()
Returns a boolean indicating whether or not a writable file exists.


canRead

boolean canRead()
Returns a boolean indicating whether or not a readable file exists.


isFile

boolean isFile()
Returns a boolean indicating whether or not a normal file exists.


isDirectory

boolean isDirectory()
Returns a boolean indicating whether or not a directory file exists.


isAbsolute

boolean isAbsolute()
Returns a boolean indicating whether the file name is absolute.


lastModified

long lastModified()
Returns the last modification time. The return value should only be used to compare modification dates. It is meaningless as an absolute time.


length

long length()
Returns the length of the file.


mkdir

boolean mkdir()
Creates a directory and returns a boolean indicating the success of the creation. Will return false if the directory already exists.


renameTo

boolean renameTo(java.io.File dest)
Renames a file and returns a boolean indicating whether or not this method was successful.

Parameters:
dest - the new file name

mkdirs

boolean mkdirs()
Creates all directories in this path. This method returns true if the target (deepest) directory was created, false if the target directory was not created (e.g., if it existed previously).


list

java.lang.String[] list()
Lists the files in a directory. Works only on directories.

Returns:
an array of file names. This list will include all files in the directory except the equivalent of "." and ".." .

list

java.lang.String[] list(java.io.FilenameFilter filter)
Uses the specified filter to list files in a directory.

Parameters:
filter - the filter used to select file names
Returns:
the filter selected files in this directory.
See Also:
FilenameFilter

delete

boolean delete()
Deletes the specified file. Returns true if the file could be deleted.