com.sun.xfilechooser
Class XFileSystemView
FileSystemView
com.sun.xfilechooser.XFileSystemView
public abstract class XFileSystemView
extends FileSystemView
XFileSystemView class allows the XFileChooser to provide
XFile object data to the FileSystemView of the JFileChooser.
This class overrides the FileSystemView provided by JFileChooser.
Whenever an XFileChooser constructor is called the FileSystemView
that is set would be the XFileSystemView.
File | createFileObject(File dir, String filename) - Creates a File object constructed from File obj and filename
|
File | createFileObject(String path) - Creates a file object constructed from give pathname
|
static FileSystemView | getFileSystemView() - Depending on type of operating system (e.g.
|
File[] | getFiles(File dir, boolean useFileHiding) - Returns the list of files in a directory
|
File | getHomeDirectory() - Returns the user's home directory
|
File | getParentDirectory(File dir) - Returns the parent directory of specified directory/file object
|
boolean | isRoot(File f) - Returns true if the given file object is root.
|
createFileObject
public File createFileObject(File dir,
String filename)
Creates a File object constructed from File obj and filename
dir
- file object of directoryfilename
- name of file in directory
createFileObject
public File createFileObject(String path)
Creates a file object constructed from give pathname
- File object constructed from the given path string.
getFileSystemView
public static FileSystemView getFileSystemView()
Depending on type of operating system (e.g. unix, windows, or generic)
it would return the file system view.
- FileSystemView the operating system file system view
getFiles
public File[] getFiles(File dir,
boolean useFileHiding)
Returns the list of files in a directory
dir
- directoryuseFileHiding
- flag to indicate to either show files hidden or not.
- File[] array of files in the directory
getHomeDirectory
public File getHomeDirectory()
Returns the user's home directory
- File object of user's home directory
getParentDirectory
public File getParentDirectory(File dir)
Returns the parent directory of specified directory/file object
isRoot
public boolean isRoot(File f)
Returns true if the given file object is root.
f
- file object to check if root
- boolean value if file object is root (true) or not (false)