com.sun.xfilechooser

Class 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.

Method Summary

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.

Method Details

createFileObject

public File createFileObject(File dir,
                             String filename)
Creates a File object constructed from File obj and filename
Parameters:
dir - file object of directory
filename - name of file in directory
Returns:
File object created

createFileObject

public File createFileObject(String path)
Creates a file object constructed from give pathname
Returns:
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.
Returns:
FileSystemView the operating system file system view

getFiles

public File[] getFiles(File dir,
                       boolean useFileHiding)
Returns the list of files in a directory
Parameters:
dir - directory
useFileHiding - flag to indicate to either show files hidden or not.
Returns:
File[] array of files in the directory

getHomeDirectory

public File getHomeDirectory()
Returns the user's home directory
Returns:
File object of user's home directory

getParentDirectory

public File getParentDirectory(File dir)
Returns the parent directory of specified directory/file object
Parameters:
dir - directory
Returns:
parent directory

isRoot

public boolean isRoot(File f)
Returns true if the given file object is root.
Parameters:
f - file object to check if root
Returns:
boolean value if file object is root (true) or not (false)