java.lang.Object
javax.swing.filechooser.FileSystemView
public abstract class FileSystemView extends Object
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 Constructor Description FileSystemView()
Constructs a FileSystemView. -
Method Summary
Modifier and Type Method Description File
createFileObject(File dir, String filename)
Returns a File object constructed in dir from the given filename.File
createFileObject(String path)
Returns a File object constructed from the given path string.protected File
createFileSystemRoot(File f)
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
getChild(File parent, String fileName)
File[]
getChooserComboBoxFiles()
Returns an array of files representing the values which will be shown in the file chooser selector.File[]
getChooserShortcutPanelFiles()
Returns an array of files representing the values to show by default in the file chooser shortcuts panel.File
getDefaultDirectory()
Return the user's default starting directory for the file chooser.File[]
getFiles(File dir, boolean useFileHiding)
Gets the list of shown (i.e. not hidden) files.static FileSystemView
getFileSystemView()
Returns the file system view.File
getHomeDirectory()
Returns the home directory.File
getLinkLocation(File file)
Returns the regular file referenced by the specified link file if the specified file is a shell interpreted link.File
getParentDirectory(File dir)
Returns the parent directory ofdir
.File[]
getRoots()
Returns all root partitions on this system.