public abstract class AbstractVFSFileSystemView extends Object
| Constructor and Description |
|---|
AbstractVFSFileSystemView() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.commons.vfs2.FileObject |
createFileObject(org.apache.commons.vfs2.FileObject dir,
String filename)
Returns a File object constructed in dir from the given filename.
|
org.apache.commons.vfs2.FileObject |
createFileObject(String path)
Returns a File object constructed from the given path string.
|
protected org.apache.commons.vfs2.FileObject |
createFileSystemRoot(org.apache.commons.vfs2.FileObject f)
Creates a new
File object for f with correct
behavior for a file system root directory. |
abstract org.apache.commons.vfs2.FileObject |
createNewFolder(org.apache.commons.vfs2.FileObject containingDir)
Creates a new folder with a default folder name.
|
org.apache.commons.vfs2.FileObject |
getChild(org.apache.commons.vfs2.FileObject parent,
String fileName) |
org.apache.commons.vfs2.FileObject |
getDefaultDirectory()
Return the user's default starting directory for the file chooser.
|
org.apache.commons.vfs2.FileObject[] |
getFiles(org.apache.commons.vfs2.FileObject dir,
boolean useFileHiding)
Gets the list of shown (i.e.
|
static AbstractVFSFileSystemView |
getFileSystemView() |
org.apache.commons.vfs2.FileObject |
getHomeDirectory() |
org.apache.commons.vfs2.FileObject |
getParentDirectory(org.apache.commons.vfs2.FileObject dir)
Returns the parent directory of
dir. |
org.apache.commons.vfs2.FileObject[] |
getRoots(org.apache.commons.vfs2.FileObject fo)
Returns all root partitions on this system.
|
String |
getSystemDisplayName(org.apache.commons.vfs2.FileObject f)
Name of a file, directory, or folder as it would be displayed in
a system file browser.
|
Icon |
getSystemIcon(org.apache.commons.vfs2.FileObject f)
Icon for a file, directory, or folder as it would be displayed in
a system file browser.
|
String |
getSystemTypeDescription(org.apache.commons.vfs2.FileObject f)
Type description for a file, directory, or folder as it would be displayed in
a system file browser.
|
boolean |
isComputerNode(org.apache.commons.vfs2.FileObject dir)
Used by UI classes to decide whether to display a special icon
for a computer node, e.g.
|
boolean |
isDrive(org.apache.commons.vfs2.FileObject dir)
Used by UI classes to decide whether to display a special icon
for drives or partitions, e.g.
|
boolean |
isFileSystem(org.apache.commons.vfs2.FileObject f)
Checks if
f represents a real directory or file as opposed to a
special folder such as "Desktop". |
boolean |
isFileSystemRoot(org.apache.commons.vfs2.FileObject dir)
Is dir the root of a tree in the file system, such as a drive
or partition.
|
boolean |
isFloppyDrive(org.apache.commons.vfs2.FileObject dir)
Used by UI classes to decide whether to display a special icon
for a floppy disk.
|
boolean |
isHiddenFile(org.apache.commons.vfs2.FileObject f)
Returns whether a file is hidden or not.
|
boolean |
isParent(org.apache.commons.vfs2.FileObject folder,
org.apache.commons.vfs2.FileObject file)
On Windows, a file can appear in multiple folders, other than its
parent directory in the filesystem.
|
boolean |
isRoot(org.apache.commons.vfs2.FileObject f)
Determines if the given file is a root in the navigatable tree(s).
|
Boolean |
isTraversable(org.apache.commons.vfs2.FileObject f)
Returns true if the file (directory) can be visited.
|
public static AbstractVFSFileSystemView getFileSystemView()
public boolean isRoot(org.apache.commons.vfs2.FileObject f)
C:\, D:\, etc. Unix has one root,
the "/" directory.
The default implementation gets information from the ShellFolder class.f - a File object representing a directorytrue if f is a root in the navigatable tree.isFileSystemRoot(org.apache.commons.vfs2.FileObject)public Boolean isTraversable(org.apache.commons.vfs2.FileObject f)
f - the Filetrue if the file/directory can be traversed, otherwise falseJFileChooser.isTraversable(java.io.File),
FileView.isTraversable(java.io.File)public String getSystemDisplayName(org.apache.commons.vfs2.FileObject f)
f - a File objectJFileChooser.getName(java.io.File)public String getSystemTypeDescription(org.apache.commons.vfs2.FileObject f)
f - a File objectJFileChooser.getTypeDescription(java.io.File)public Icon getSystemIcon(org.apache.commons.vfs2.FileObject f)
f - a File objectJFileChooser.getIcon(java.io.File)public boolean isParent(org.apache.commons.vfs2.FileObject folder,
org.apache.commons.vfs2.FileObject file)
folder - a File object repesenting a directory or special folderfile - a File objecttrue if folder is a directory or special folder and contains file.public org.apache.commons.vfs2.FileObject getChild(org.apache.commons.vfs2.FileObject parent,
String fileName)
parent - a File object repesenting a directory or special folderfileName - a name of a file or folder which exists in parentnew
File(parent, fileName) except when parent and child are both
special folders, in which case the File is a wrapper containing
a ShellFolder object.public boolean isFileSystem(org.apache.commons.vfs2.FileObject f)
f represents a real directory or file as opposed to a
special folder such as "Desktop". Used by UI classes to decide if
a folder is selectable when doing directory choosing.f - a File objecttrue if f is a real file or directory.public abstract org.apache.commons.vfs2.FileObject createNewFolder(org.apache.commons.vfs2.FileObject containingDir)
throws org.apache.commons.vfs2.FileSystemException
containingDir - org.apache.commons.vfs.FileSystemExceptionorg.apache.commons.vfs2.FileSystemExceptionpublic boolean isHiddenFile(org.apache.commons.vfs2.FileObject f)
f - public boolean isFileSystemRoot(org.apache.commons.vfs2.FileObject dir)
dir - a File object representing a directorytrue if f is a root of a filesystemisRoot(org.apache.commons.vfs2.FileObject)public boolean isDrive(org.apache.commons.vfs2.FileObject dir)
dir - a directoryfalse alwayspublic boolean isFloppyDrive(org.apache.commons.vfs2.FileObject dir)
dir - a directoryfalse alwayspublic boolean isComputerNode(org.apache.commons.vfs2.FileObject dir)
dir - a directoryfalse alwayspublic org.apache.commons.vfs2.FileObject[] getRoots(org.apache.commons.vfs2.FileObject fo)
fo - public org.apache.commons.vfs2.FileObject getHomeDirectory()
public org.apache.commons.vfs2.FileObject getDefaultDirectory()
File object representing the default
starting folderpublic org.apache.commons.vfs2.FileObject createFileObject(org.apache.commons.vfs2.FileObject dir,
String filename)
dir - filename - public org.apache.commons.vfs2.FileObject createFileObject(String path)
path - public org.apache.commons.vfs2.FileObject[] getFiles(org.apache.commons.vfs2.FileObject dir,
boolean useFileHiding)
dir - useFileHiding - public org.apache.commons.vfs2.FileObject getParentDirectory(org.apache.commons.vfs2.FileObject dir)
dir.dir - the File being querieddir, or
null if dir is nullprotected org.apache.commons.vfs2.FileObject createFileSystemRoot(org.apache.commons.vfs2.FileObject f)
File object for f with correct
behavior for a file system root directory.f - a File object representing a file system root
directory, for example "/" on Unix or "C:\" on Windows.File objectCopyright © 2020. All rights reserved.