public abstract class FileSystemView extends java.lang.Object
JFileChooser component.| Constructor and Description |
|---|
FileSystemView() |
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
createFileObject(java.io.File dir,
java.lang.String filename)
Creates a new file object with the given name in the specified directory.
|
java.io.File |
createFileObject(java.lang.String path)
Creates a new file object from the specified path.
|
protected java.io.File |
createFileSystemRoot(java.io.File f)
DOCUMENT ME!
|
abstract java.io.File |
createNewFolder(java.io.File containingDir)
Creates a new folder with a unique name in the specified directory and
returns a
File object representing the new directory. |
java.io.File |
getChild(java.io.File parent,
java.lang.String fileName)
DOCUMENT ME!
|
java.io.File |
getDefaultDirectory()
Returns the default directory.
|
java.io.File[] |
getFiles(java.io.File dir,
boolean useFileHiding)
Returns an array containing the files in the given directory.
|
static FileSystemView |
getFileSystemView()
Returns a default
FileSystemView appropriate for the platform. |
java.io.File |
getHomeDirectory()
Returns the home directory for the current user.
|
java.io.File |
getParentDirectory(java.io.File f)
Returns the parent directory for the given file/directory.
|
java.io.File[] |
getRoots()
Returns an array containing the file system roots.
|
java.lang.String |
getSystemDisplayName(java.io.File f)
Returns the name of a file as it would be displayed by the underlying
system.
|
javax.swing.Icon |
getSystemIcon(java.io.File f)
Returns the icon that would be displayed for the given file by the
underlying system.
|
java.lang.String |
getSystemTypeDescription(java.io.File f)
Returns the type description of a file that would be displayed by the
underlying system.
|
boolean |
isComputerNode(java.io.File dir)
DOCUMENT ME!
|
boolean |
isDrive(java.io.File dir)
Returns
true if the given directory represents a disk
drive, and false otherwise. |
boolean |
isFileSystem(java.io.File f)
Returns
true if f is a file or directory, and
false otherwise. |
boolean |
isFileSystemRoot(java.io.File dir)
Returns
true if the given directory is a file system root,
and false otherwise. |
boolean |
isFloppyDrive(java.io.File dir)
Returns
true if the given directory represents a floppy
drive, and false otherwise. |
boolean |
isHiddenFile(java.io.File f)
Returns
true if the given file is hidden, and
false otherwise. |
boolean |
isParent(java.io.File folder,
java.io.File file)
Returns
true if folder is the parent of
file, and false otherwise. |
boolean |
isRoot(java.io.File f)
DOCUMENT ME!
|
java.lang.Boolean |
isTraversable(java.io.File f)
Returns
true if the file is traversable, and
false otherwise. |
public FileSystemView()
public java.io.File createFileObject(java.io.File dir, java.lang.String filename)
dir - the directory (null permitted).filename - the file name.public java.io.File createFileObject(java.lang.String path)
path - the path.protected java.io.File createFileSystemRoot(java.io.File f)
f - DOCUMENT ME!public abstract java.io.File createNewFolder(java.io.File containingDir) throws java.io.IOException
File object representing the new directory.containingDir - the directory to contain the new folder
(null not permitted).File object representing the new directory.java.io.IOException - if an exception occurs while creating the new
directory.public java.io.File getChild(java.io.File parent, java.lang.String fileName)
parent - DOCUMENT ME!fileName - DOCUMENT ME!public java.io.File getDefaultDirectory()
public java.io.File[] getFiles(java.io.File dir, boolean useFileHiding)
useFileHiding controls whether or not hidden files are
included in the result.dir - the directory (if nulluseFileHiding - a flag that controls whether or not hidden files are
included in the result (pass in true to
exclude hidden files).null).public static FileSystemView getFileSystemView()
FileSystemView appropriate for the platform.FileSystemView appropriate for the platform.public java.io.File getHomeDirectory()
public java.io.File getParentDirectory(java.io.File f)
f - the file/directory.null if there is no parent
directory).public java.io.File[] getRoots()
This method is implemented to return null, subclasses must
override this method.
public java.lang.String getSystemDisplayName(java.io.File f)
f - the file.public javax.swing.Icon getSystemIcon(java.io.File f)
null,
subclasses must override.f - the file.null.public java.lang.String getSystemTypeDescription(java.io.File f)
null,
subclasses must override.f - the file.null.public boolean isComputerNode(java.io.File dir)
dir - DOCUMENT ME!public boolean isDrive(java.io.File dir)
true if the given directory represents a disk
drive, and false otherwise. This default implementation
always returns false.dir - the directory.false.public boolean isFileSystem(java.io.File f)
true if f is a file or directory, and
false otherwise.f - the file/directory.true if f is a file or directory, and
false otherwise.public boolean isFileSystemRoot(java.io.File dir)
true if the given directory is a file system root,
and false otherwise.dir - the directory.true if the given directory is a file system root,
and false otherwise.public boolean isFloppyDrive(java.io.File dir)
true if the given directory represents a floppy
drive, and false otherwise. This default implementation
always returns false.dir - the directory.false.public boolean isHiddenFile(java.io.File f)
true if the given file is hidden, and
false otherwise.f - the file.true if the given file is hidden, and
false otherwise.public boolean isParent(java.io.File folder, java.io.File file)
true if folder is the parent of
file, and false otherwise.folder - the folder (null not permitted).file - the file (null not permitted).true if folder is the parent of
file, and false otherwise.public boolean isRoot(java.io.File f)
f - DOCUMENT ME!public java.lang.Boolean isTraversable(java.io.File f)
true if the file is traversable, and
false otherwise. Here, all directories are considered
traversable, and files are considered non-traversable.f - the file or directory (null not permitted).true if the file is traversable, and
false otherwise.