|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.filechooser.FileSystemView
public abstract class FileSystemView
The base class providing a view of the file system for use by the
JFileChooser
component.
Constructor Summary | |
---|---|
FileSystemView()
|
Method Summary | |
---|---|
File |
createFileObject(File dir,
String filename)
Creates a new file object with the given name in the specified directory. |
File |
createFileObject(String path)
Creates a new file object from the specified path. |
protected File |
createFileSystemRoot(File f)
DOCUMENT ME! |
abstract File |
createNewFolder(File containingDir)
Creates a new folder with a unique name in the specified directory and returns a File object representing the new directory. |
File |
getChild(File parent,
String fileName)
DOCUMENT ME! |
File |
getDefaultDirectory()
Returns the default directory. |
File[] |
getFiles(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. |
File |
getHomeDirectory()
Returns the home directory for the current user. |
File |
getParentDirectory(File f)
Returns the parent directory for the given file/directory. |
File[] |
getRoots()
Returns an array containing the file system roots. |
String |
getSystemDisplayName(File f)
Returns the name of a file as it would be displayed by the underlying system. |
Icon |
getSystemIcon(File f)
Returns the icon that would be displayed for the given file by the underlying system. |
String |
getSystemTypeDescription(File f)
Returns the type description of a file that would be displayed by the underlying system. |
boolean |
isComputerNode(File dir)
DOCUMENT ME! |
boolean |
isDrive(File dir)
Returns true if the given directory represents a disk
drive, and false otherwise. |
boolean |
isFileSystem(File f)
Returns true if f is a file or directory, and
false otherwise. |
boolean |
isFileSystemRoot(File dir)
Returns true if the given directory is a file system root,
and false otherwise. |
boolean |
isFloppyDrive(File dir)
Returns true if the given directory represents a floppy
drive, and false otherwise. |
boolean |
isHiddenFile(File f)
Returns true if the given file is hidden, and
false otherwise. |
boolean |
isParent(File folder,
File file)
Returns true if folder is the parent of
file , and false otherwise. |
boolean |
isRoot(File f)
DOCUMENT ME! |
Boolean |
isTraversable(File f)
Returns true if the file is traversable, and
false otherwise. |
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 File createFileObject(File dir, String filename)
dir
- the directory (null
permitted).filename
- the file name.
public File createFileObject(String path)
path
- the path.
protected File createFileSystemRoot(File f)
f
- DOCUMENT ME!
public abstract File createNewFolder(File containingDir) throws IOException
File
object representing the new directory.
containingDir
- the directory to contain the new folder
(null
not permitted).
File
object representing the new directory.
IOException
- if an exception occurs while creating the new
directory.public File getChild(File parent, String fileName)
parent
- DOCUMENT ME!fileName
- DOCUMENT ME!
public File getDefaultDirectory()
public File[] getFiles(File dir, boolean useFileHiding)
useFileHiding
controls whether or not hidden files are
included in the result.
dir
- the directory (if null
useFileHiding
- 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 File getHomeDirectory()
public File getParentDirectory(File f)
f
- the file/directory.
null
if there is no parent
directory).public File[] getRoots()
This method is implemented to return null
, subclasses must
override this method.
public String getSystemDisplayName(File f)
f
- the file.
public Icon getSystemIcon(File f)
null
,
subclasses must override.
f
- the file.
null
.public String getSystemTypeDescription(File f)
null
,
subclasses must override.
f
- the file.
null
.public boolean isComputerNode(File dir)
dir
- DOCUMENT ME!
public boolean isDrive(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(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(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(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(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(File folder, 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(File f)
f
- DOCUMENT ME!
public Boolean isTraversable(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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |