Additional top-level classes in compilation unit: UnixFileSystemView, WindowsFileSystemView, GenericFileSystemView.
Java Licensees may want to provide a different implementation of FileSystemView to better handle a given operating system.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static FileSystemView | |
| pack-priv static FileSystemView | |
| private boolean | |
| pack-priv static FileSystemView |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public File | Returns: aFile object created from dir and filenamean abstract pathname denoting a directory dir, String a filename)String representation of a pathnameReturns a File object constructed in dir from the given filename. |
| public File | Returns: aFile object created from the given pathString representation of pathReturns a File object constructed from the given path string. |
| protected File | Returns: a newFile objecta f)File object representing a file system root
directory, for example "/" on Unix or "C:\" on Windows.Creates a new |
| public abstract File | Returns: aFile object denoting the newly created foldera containingDir)File object denoting directory to contain the new folderCreates a new folder with a default folder name. |
| public File | Returns: a File object.a parent, String File object representing a directory or special foldera name of a file or folder which exists in fileName)parentReturns a |
| public File[] | Returns: an array ofFile objects. The array returned may be
possibly empty if there are no appropriate permissions.Returns an array of files representing the values which will be shown in the file chooser selector. |
| public final File[] | Returns: an array ofFile objects. The array returned may be
possibly empty if there are no appropriate permissions.Returns an array of files representing the values to show by default in the file chooser shortcuts panel. |
| public File | Returns: aFile object representing the default
starting folderReturn the user's default starting directory for the file chooser. |
| public File[] | Returns: an array ofFile objects representing files and
directories in the given dir. It includes hidden
files if useFileHiding is false.the root directory of files to be returned dir, boolean determine if hidden files are returned useFileHiding)Gets the list of shown (i.e. not hidden) files. |
| public static FileSystemView | |
| public File | |
| public File | Returns: the linked file ornull.a file file)Returns the regular file referenced by the specified link file if the specified file is a shell interpreted link. |
| public File | Returns: the parent directory ofdir, or
null if dir is nullthe dir)File being queriedReturns the parent directory of |
| public File[] | Returns: an array ofFile objects representing all root partitions
on this systemReturns all root partitions on this system. |
| pack-priv ShellFolder | getShellFolder(File f)
Throws |
| public String | Returns: the file name as it would be displayed by a native file choosera f)File objectName of a file, directory, or folder as it would be displayed in a system file browser. |
| public Icon | Returns: an icon as it would be displayed by a native file choosera f)File objectIcon for a file, directory, or folder as it would be displayed in a system file browser. |
| public Icon | Returns: an icon as it would be displayed by a native file chooser or null for a non-existent or inaccessible file.a f, int File object for which the icon will be retrievedwidth of the icon in user coordinate system. width, int height of the icon in user coordinate system. height)Returns an icon for a file, directory, or folder as it would be displayed in a system file browser for the requested size. |
| public String | Returns: the file type description as it would be displayed by a native file chooser or null if no native information is available.a f)File objectType description for a file, directory, or folder as it would be displayed in a system file browser. |
| public boolean | Returns: false alwaysa directory dir)Used by UI classes to decide whether to display a special icon for a computer node, e.g. "My Computer" or a network server. |
| public boolean | |
| public boolean | Returns: true if f is a real file or directory.a f)File objectChecks if |
| public boolean | Returns: true if f is a root of a filesystema dir)File object representing a directoryIs dir the root of a tree in the file system, such as a drive or partition. |
| public boolean | Returns: false alwaysa directory dir)Used by UI classes to decide whether to display a special icon for a floppy disk. |
| public boolean | Returns: true if the givenFile denotes a hidden filea f)File objectReturns whether a file is hidden or not. |
| public boolean | Returns: whether this is a linka file file)Returns whether the specified file denotes a shell interpreted link which
can be obtained by the |
| public boolean | |
| public boolean | |
| public Boolean | Returns: true if the file/directory can be traversed, otherwise falsethe f)FileReturns true if the file (directory) can be visited. |
| genericFileSystemView | back to summary |
|---|---|
| pack-priv static FileSystemView genericFileSystemView | |
| unixFileSystemView | back to summary |
|---|---|
| pack-priv static FileSystemView unixFileSystemView | |
| useSystemExtensionHiding | back to summary |
|---|---|
| private boolean useSystemExtensionHiding | |
| windowsFileSystemView | back to summary |
|---|---|
| pack-priv static FileSystemView windowsFileSystemView | |
| FileSystemView | back to summary |
|---|---|
| public FileSystemView() Constructs a FileSystemView. | |
| createFileObject | back to summary |
|---|---|
| public File createFileObject(File dir, String filename) Returns a File object constructed in dir from the given filename. | |
| createFileObject | back to summary |
|---|---|
| public File createFileObject(String path) Returns a File object constructed from the given path string. | |
| createFileSystemRoot | back to summary |
|---|---|
| protected File createFileSystemRoot(File f) Creates a new | |
| createNewFolder | back to summary |
|---|---|
| public abstract File createNewFolder(File containingDir) throws IOException Creates a new folder with a default folder name.
| |
| getChild | back to summary |
|---|---|
| public File getChild(File parent, String fileName) Returns a | |
| getChooserComboBoxFiles | back to summary |
|---|---|
| public File[] getChooserComboBoxFiles() Returns an array of files representing the values which will be shown in the file chooser selector.
| |
| getChooserShortcutPanelFiles | back to summary |
|---|---|
| public final File[] getChooserShortcutPanelFiles() Returns an array of files representing the values to show by default in the file chooser shortcuts panel.
| |
| getDefaultDirectory | back to summary |
|---|---|
| public File getDefaultDirectory() Return the user's default starting directory for the file chooser.
| |
| getFiles | back to summary |
|---|---|
| public File[] getFiles(File dir, boolean useFileHiding) Gets the list of shown (i.e. not hidden) files. | |
| getFileSystemView | back to summary |
|---|---|
| public static FileSystemView getFileSystemView() Returns the file system view.
| |
| getHomeDirectory | back to summary |
|---|---|
| public File getHomeDirectory() Returns the home directory.
| |
| getLinkLocation | back to summary |
|---|---|
| public File getLinkLocation(File file) throws FileNotFoundException Returns the regular file referenced by the specified link file if
the specified file is a shell interpreted link.
Returns
| |
| getParentDirectory | back to summary |
|---|---|
| public File getParentDirectory(File dir) Returns the parent directory of | |
| getRoots | back to summary |
|---|---|
| public File[] getRoots() 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.
| |
| getShellFolder | back to summary |
|---|---|
| pack-priv ShellFolder getShellFolder(File f) throws FileNotFoundException Throws | |
| getSystemDisplayName | back to summary |
|---|---|
| public String getSystemDisplayName(File f) 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.
| |
| getSystemIcon | back to summary |
|---|---|
| public Icon getSystemIcon(File f) 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.
| |
| getSystemIcon | back to summary |
|---|---|
| public Icon 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. Example:
FileSystemView fsv = FileSystemView.getFileSystemView();
Icon icon = fsv.getSystemIcon(new File("application.exe"), 64, 64);
JLabel label = new JLabel(icon);
Implementation Specification The available icons may be platform specific and so the available sizes determined by the platform. Therefore an exact match for the requested size may not be possible. The icon returned may be a multi-resolution icon image, which allows better support for High DPI environments with different scaling factors.
| |
| getSystemTypeDescription | back to summary |
|---|---|
| public String getSystemTypeDescription(File f) 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 described as "Desktop". Override for platforms with native ShellFolder implementations.
| |
| isComputerNode | back to summary |
|---|---|
| public boolean isComputerNode(File dir) 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.
| |
| isDrive | back to summary |
|---|---|
| public boolean isDrive(File dir) Used 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.
| |
| isFileSystem | back to summary |
|---|---|
| public boolean isFileSystem(File f) Checks if
| |
| isFileSystemRoot | back to summary |
|---|---|
| public boolean isFileSystemRoot(File dir) 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. | |
| isFloppyDrive | back to summary |
|---|---|
| public boolean isFloppyDrive(File dir) Used 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.
| |
| isHiddenFile | back to summary |
|---|---|
| public boolean isHiddenFile(File f) Returns whether a file is hidden or not.
| |
| isLink | back to summary |
|---|---|
| public boolean isLink(File file) Returns whether the specified file denotes a shell interpreted link which
can be obtained by the
| |
| isParent | back to summary |
|---|---|
| public boolean isParent(File folder, File file) On 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(). | |
| isRoot | back to summary |
|---|---|
| public boolean isRoot(File f) Determines if the given file is a root in the navigable tree(s).
Examples: Windows 98 has one root, the Desktop folder. DOS has one root
per drive letter,
| |
| isTraversable | back to summary |
|---|---|
| public Boolean isTraversable(File f) Returns true if the file (directory) can be visited. Returns false if the directory cannot be traversed.
| |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String | |
| public boolean | isDirectory()
Overrides java. Tests whether the file located by this abstract pathname is a directory. |
| FileSystemRoot | back to summary |
|---|---|
| public FileSystemRoot(File f) | |
| FileSystemRoot | back to summary |
|---|---|
| public FileSystemRoot(String s) | |
| getName | back to summary |
|---|---|
| public String getName() Overrides java. Doc from java. Returns the name component of this abstract pathname. This is just the last name in the pathname's name sequence. If the pathname's name sequence is empty, then the empty string is returned. | |
| isDirectory | back to summary |
|---|---|
| public boolean isDirectory() Overrides java. Doc from java. Tests whether the file located by this abstract pathname is a directory. Where it is required to distinguish an I/O exception from the case
that the file is not a directory, or where several attributes of the
same file are required at the same time, then the | |