JavaTM 2 Platform
Std. Ed. v1.3

javax.swing.filechooser
Class FileSystemView

java.lang.Object
  |
  +--javax.swing.filechooser.FileSystemView

public abstract class FileSystemView
extends Object

FileSystemView is JFileChooser's gateway to the file system. Since the JDK1.1 File api doesn't allow access to such information as root partitians, file type information, or hidden file bits, this class is designed to intuit as much OS specific file system information as possible. FileSystemView will eventually delegate its responsibilities to io File classes when JDK1.X provides more direct access to file system information. Java Licenses may want to provide a different implemenation of FileSystemView to better handle a given operation system. PENDING(jeff) - need to provide a specification for how Mac/OS2/BeOS/etc file systems can modify FileSystemView to handle their particular type of file system.


Constructor Summary
FileSystemView()
           
 
Method Summary
 File createFileObject(File dir, String filename)
          Returns a File object constructed in dir from the given filename.
 File createFileObject(String path)
          Returns a File object constructed from the given path string.
abstract  File createNewFolder(File containingDir)
          creates a new folder with a default folder name.
 File[] getFiles(File dir, boolean useFileHiding)
          gets the list of shown (i.e.
static FileSystemView getFileSystemView()
           
 File getHomeDirectory()
           
 File getParentDirectory(File dir)
          Returns the parent directory of dir.
abstract  File[] getRoots()
          Returns all root partitians on this system.
abstract  boolean isHiddenFile(File f)
          Returns whether a file is hidden or not.
abstract  boolean isRoot(File f)
          Determines if the given file is a root partition or drive.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemView

public FileSystemView()
Method Detail

getFileSystemView

public static FileSystemView getFileSystemView()

isRoot

public abstract boolean isRoot(File f)
Determines if the given file is a root partition or drive.

createNewFolder

public abstract File createNewFolder(File containingDir)
                              throws IOException
creates a new folder with a default folder name.

isHiddenFile

public abstract boolean isHiddenFile(File f)
Returns whether a file is hidden or not.

getRoots

public abstract File[] getRoots()
Returns all root partitians on this system. For example, on Windows, this would be the A: through Z: drives.

getHomeDirectory

public File getHomeDirectory()

createFileObject

public File createFileObject(File dir,
                             String filename)
Returns a File object constructed in dir from the given filename.

createFileObject

public File createFileObject(String path)
Returns a File object constructed from the given path string.

getFiles

public File[] getFiles(File dir,
                       boolean useFileHiding)
gets the list of shown (i.e. not hidden) files

getParentDirectory

public File getParentDirectory(File dir)
Returns the parent directory of dir.

JavaTM 2 Platform
Std. Ed. v1.3

Submit a bug or feature
For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.

Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.