java.lang.Object | |
↳ | javax.swing.filechooser.FileSystemView |
FileSystemView is JFileChooser's gateway to the file system. Since the JDK1.1 File API doesn't allow access to such information as root partitions, file type information, or hidden file bits, this class is designed to intuit as much OS-specific file system information as possible.
Java Licensees may want to provide a different implementation of FileSystemView to better handle a given operating system.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a File object constructed from the given path string.
| |||||||||||
Returns a File object constructed in dir from the given filename.
| |||||||||||
Creates a new folder with a default folder name.
| |||||||||||
Return the user's default starting directory for the file chooser.
| |||||||||||
Gets the list of shown (i.e.
| |||||||||||
Returns the parent directory of
dir . | |||||||||||
Returns all root partitions on this system.
| |||||||||||
Name of a file, directory, or folder as it would be displayed in
a system file browser.
| |||||||||||
Icon for a file, directory, or folder as it would be displayed in
a system file browser.
| |||||||||||
Type description for a file, directory, or folder as it would be displayed in
a system file browser.
| |||||||||||
Used by UI classes to decide whether to display a special icon
for a computer node, e.g.
| |||||||||||
Used by UI classes to decide whether to display a special icon
for drives or partitions, e.g.
| |||||||||||
Checks if
f represents a real directory or file as opposed to a
special folder such as "Desktop" . | |||||||||||
Is dir the root of a tree in the file system, such as a drive
or partition.
| |||||||||||
Used by UI classes to decide whether to display a special icon
for a floppy disk.
| |||||||||||
Returns whether a file is hidden or not.
| |||||||||||
On Windows, a file can appear in multiple folders, other than its
parent directory in the filesystem.
| |||||||||||
Determines if the given file is a root in the navigatable tree(s).
| |||||||||||
Returns true if the file (directory) can be visited.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new
File object for f with correct
behavior for a file system root directory. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns a File object constructed from the given path string.
Returns a File object constructed in dir from the given filename.
Creates a new folder with a default folder name.
IOException |
---|
parent | a File object repesenting a directory or special folder |
---|---|
fileName | a name of a file or folder which exists in parent |
new
File(parent, fileName)
except when parent and child are both
special folders, in which case the File
is a wrapper containing
a ShellFolder
object.Return the user's default starting directory for the file chooser.
File
object representing the default
starting folderGets the list of shown (i.e. not hidden) files.
Returns the parent directory of dir
.
dir | the File being queried |
---|
dir
, or
null
if dir
is null
Returns all root partitions on this system. For example, on Windows, this would be the "Desktop" folder, while on DOS this would be the A: through Z: drives.
Name of a file, directory, or folder as it would be displayed in a system file browser. Example from Windows: the "M:\" directory displays as "CD-ROM (M:)" The default implementation gets information from the ShellFolder class.
f | a File object |
---|
Icon for a file, directory, or folder as it would be displayed in a system file browser. Example from Windows: the "M:\" directory displays a CD-ROM icon. The default implementation gets information from the ShellFolder class.
f | a File object |
---|
Type description for a file, directory, or folder as it would be displayed in a system file browser. Example from Windows: the "Desktop" folder is desribed as "Desktop". Override for platforms with native ShellFolder implementations.
f | a File object |
---|
Used by UI classes to decide whether to display a special icon for a computer node, e.g. "My Computer" or a network server. The default implementation has no way of knowing, so always returns false.
dir | a directory |
---|
false
alwaysUsed by UI classes to decide whether to display a special icon for drives or partitions, e.g. a "hard disk" icon. The default implementation has no way of knowing, so always returns false.
dir | a directory |
---|
false
alwaysChecks if f
represents a real directory or file as opposed to a
special folder such as "Desktop"
. Used by UI classes to decide if
a folder is selectable when doing directory choosing.
f | a File object |
---|
true
if f
is a real file or directory.Is dir the root of a tree in the file system, such as a drive or partition. Example: Returns true for "C:\" on Windows 98.
dir | a File object representing a directory |
---|
true
if f
is a root of a filesystemUsed by UI classes to decide whether to display a special icon for a floppy disk. Implies isDrive(dir). The default implementation has no way of knowing, so always returns false.
dir | a directory |
---|
false
alwaysOn Windows, a file can appear in multiple folders, other than its parent directory in the filesystem. Folder could for example be the "Desktop" folder which is not the same as file.getParentFile().
folder | a File object repesenting a directory or special folder |
---|---|
file | a File object |
true
if folder
is a directory or special folder and contains file
.Determines if the given file is a root in the navigatable tree(s).
Examples: Windows 98 has one root, the Desktop folder. DOS has one root
per drive letter, C:\
, D:\
, etc. Unix has one root,
the "/"
directory.
The default implementation gets information from the ShellFolder
class.
f | a File object representing a directory |
---|
true
if f
is a root in the navigatable tree.Returns true if the file (directory) can be visited. Returns false if the directory cannot be traversed.
f | the File |
---|
true
if the file/directory can be traversed, otherwise false
Creates a new File
object for f
with correct
behavior for a file system root directory.
f | a File object representing a file system root
directory, for example "/" on Unix or "C:\" on Windows. |
---|
File
object