File.list

File.list

Class Overview | Class Members | This Package | All Packages

Syntax 1
public String[] list()
Returns
an array of file names in the specified directory. This list does not include the current directory or the parent directory ("." and ".." on Unix systems).
Description
Returns a list of the files in the directory specified by this File object.

Exceptions
SecurityException If a security manager exists, its checkRead method is called with the pathname of this File to see if the application is allowed read access to the file.
See Also
getPath, checkRead



Syntax 2
public String[] list( FilenameFilter filter )
Parameters
filter
a filename filter.
Returns
an array of file names in the specified directory. This list does not include the current directory or the parent directory ("." and ".." on Unix systems).
Description
Returns a list of the files in the directory specified by this File that satisfy the specified filter.

Exceptions
SecurityException If a security manager exists, its checkRead method is called with the pathname of this File to see if the application is allowed read access to the file.
See Also
getPath, FilenameFilter, checkRead