is new.
java.lang.Objectjavax.swing.filechooser.FileSystemView
public abstract class 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 | |
|---|---|
|
FileSystemView
() |
|
| Method Summary | |
|---|---|
| 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 new File object for f 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 |
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. |
| static FileSystemView |
getFileSystemView
() |
| File |
getHomeDirectory
() |
| File |
getParentDirectory
(
File
dir) Returns the parent directory of dir. |
| File [] |
getRoots
() Returns all root partitions on this system. |
| String |
getSystemDisplayName
(
File
f) Name of a file, directory, or folder as it would be displayed in a system file browser. |
| Icon |
getSystemIcon
(
File
f) Icon for a file, directory, or folder as it would be displayed in a system file browser. |
| String |
getSystemTypeDescription
(
File
f) 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 |
isDrive
(
File
dir) Used by UI classes to decide whether to display a special icon for drives or partitions, e.g. |
| boolean |
isFileSystem
(
File
f) Checks if f 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 |
isParent
(
File
folder,
File
file) On Windows, a file can appear in multiple folders, other than its parent directory in the filesystem. |
| boolean |
isRoot
(
File
f) Determines if the given file is a root in the navigatable tree(s). |
| Boolean |
isTraversable
(
File
f) Returns true if the file (directory) can be visited. |
| Methods inherited from class java.lang. Object |
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
| Constructor Detail |
|---|
public FileSystemView()
| Method Detail |
|---|
public static FileSystemView getFileSystemView()
public boolean isRoot(File f)
public Boolean isTraversable(File f)
Since:
1.4
public String getSystemDisplayName(File f)
Since:
1.4
public String getSystemTypeDescription(File f)
Since:
1.4
public Icon getSystemIcon(File f)
Since:
1.4
public boolean isParent(File folder,
File file)
Since:
1.4
public File getChild(File parent,
String fileName)
Since:
1.4
public boolean isFileSystem(File f)
Since:
1.4
public abstract File createNewFolder(File containingDir)
throws IOException
public boolean isHiddenFile(File f)
public boolean isFileSystemRoot(File dir)
dir
Since:
1.4
public boolean isDrive(File dir)
Since:
1.4
public boolean isFloppyDrive(File dir)
Since:
1.4
public boolean isComputerNode(File dir)
Since:
1.4
public File[] getRoots()
public File getHomeDirectory()
public File getDefaultDirectory()
Since:
1.4
public File createFileObject(File dir,
String filename)
public File createFileObject(String path)
public File[] getFiles(File dir,
boolean useFileHiding)
public File getParentDirectory(File dir)
protected File createFileSystemRoot(File f)
Since:
1.4