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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFileObject
(File dir, String filename) Returns a File object constructed in dir from the given filename.createFileObject
(String path) Returns a File object constructed from the given path string.protected File
Creates a newFile
object forf
with correct behavior for a file system root directory.abstract File
createNewFolder
(File containingDir) Creates a new folder with a default folder name.File[]
Returns an array of files representing the values which will be shown in the file chooser selector.final File[]
Returns an array of files representing the values to show by default in the file chooser shortcuts panel.Return the user's default starting directory for the file chooser.File[]
Gets the list of shown (i.e. not hidden) files.static FileSystemView
Returns the file system view.Returns the home directory.getLinkLocation
(File file) Returns the regular file referenced by the specified link file if the specified file is a shell interpreted link.getParentDirectory
(File dir) Returns the parent directory ofdir
.File[]
getRoots()
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.getSystemIcon
(File f, int width, int height) Returns an icon for a file, directory, or folder as it would be displayed in a system file browser for the requested size.Type description for a file, directory, or folder as it would be displayed in a system file browser.boolean
isComputerNode
(File dir) Used by UI classes to decide whether to display a special icon for a computer node, e.g.boolean
Used by UI classes to decide whether to display a special icon for drives or partitions, e.g. a "hard disk" icon.boolean
isFileSystem
(File f) Checks iff
represents a real directory or file as opposed to a special folder such as"Desktop"
.boolean
isFileSystemRoot
(File dir) Is dir the root of a tree in the file system, such as a drive or partition.boolean
isFloppyDrive
(File dir) Used by UI classes to decide whether to display a special icon for a floppy disk.boolean
isHiddenFile
(File f) Returns whether a file is hidden or not.boolean
Returns whether the specified file denotes a shell interpreted link which can be obtained by thegetLinkLocation(File)
.boolean
On Windows, a file can appear in multiple folders, other than its parent directory in the filesystem.boolean
Determines if the given file is a root in the navigable tree(s).Returns true if the file (directory) can be visited.