com.ibm.as400.vaccess
Class IFSFileSystemView

java.lang.Object
  |
  +--javax.swing.filechooser.FileSystemView
        |
        +--com.ibm.as400.vaccess.IFSFileSystemView

public class IFSFileSystemView
extends javax.swing.filechooser.FileSystemView

IFSFileSystemView provides a gateway to the iSeries integrated file system, for use when constructing javax.swing.JFileChooser objects.

JFileChooser is a standard Java way to build dialogs for navigating and choosing files, and is the recommended replacement for IFSFileDialog.

The following example demonstrates the use of IFSFileSystemView.

See Also:
IFSFileDialog, IFSJavaFile

Constructor Summary
IFSFileSystemView(AS400 system)
          Constructs an IFSFileSystemView object.
 
Method Summary
 java.io.File createFileObject(java.io.File containingDir, java.lang.String name)
          Returns a File object constructed in directory from the given filename.
 java.io.File createFileObject(java.lang.String path)
          Returns a File object constructed from the given path string.
 java.io.File createNewFolder(java.io.File containingDir)
          Creates a new folder with a default name.
 java.io.File[] getFiles(java.io.File directory, boolean useFileHiding)
          Gets the list of shown (that is, not hidden) files in the directory.
 java.io.File getHomeDirectory()
          Returns the home directory.
 java.io.File getParentDirectory(java.io.File directory)
          Returns the parent directory of specified directory.
 java.io.File[] getRoots()
          Returns all root partitions on this system.
 boolean isHiddenFile(java.io.File file)
          Returns whether a file is hidden or not.
 boolean isRoot(java.io.File file)
          Determines if the given file is a root in the navigatable tree(s).
 
Methods inherited from class javax.swing.filechooser.FileSystemView
createFileSystemRoot, getChild, getDefaultDirectory, getFileSystemView, getSystemDisplayName, getSystemIcon, getSystemTypeDescription, isComputerNode, isDrive, isFileSystem, isFileSystemRoot, isFloppyDrive, isParent, isTraversable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IFSFileSystemView

public IFSFileSystemView(AS400 system)
Constructs an IFSFileSystemView object.

Parameters:
system - The iSeries system that contains the file.
Method Detail

createFileObject

public java.io.File createFileObject(java.io.File containingDir,
                                     java.lang.String name)
Returns a File object constructed in directory from the given filename.
Note: This method does not create an actual file in the file system.

Overrides:
createFileObject in class javax.swing.filechooser.FileSystemView
Parameters:
containingDir - The directory in which to create the file.
containingDir must be of type IFSJavaFile.
name - The file name.
Returns:
a File object representing the new file.

createFileObject

public java.io.File createFileObject(java.lang.String path)
Returns a File object constructed from the given path string.
Note: This method does not create an actual file in the file system.

Overrides:
createFileObject in class javax.swing.filechooser.FileSystemView
Parameters:
path - The file path name.
Returns:
the File object.

createNewFolder

public java.io.File createNewFolder(java.io.File containingDir)
                             throws java.io.IOException
Creates a new folder with a default name.
Note: In the context of this class, "folder" is synonymous with "directory".

Specified by:
createNewFolder in class javax.swing.filechooser.FileSystemView
Parameters:
containingDir - The parent directory in which to create the folder. Must be of type IFSJavaFile.
Returns:
a File object representing the new folder.
java.io.IOException

getFiles

public java.io.File[] getFiles(java.io.File directory,
                               boolean useFileHiding)
Gets the list of shown (that is, not hidden) files in the directory.

Overrides:
getFiles in class javax.swing.filechooser.FileSystemView
Parameters:
directory - The directory to search.
useFileHiding - This parameter is ignored.
Returns:
The list of files.

getHomeDirectory

public java.io.File getHomeDirectory()
Returns the home directory.
The iSeries integrated file system has one home directory, the "/" directory.

Overrides:
getHomeDirectory in class javax.swing.filechooser.FileSystemView
Returns:
the home directory.

getParentDirectory

public java.io.File getParentDirectory(java.io.File directory)
Returns the parent directory of specified directory.

Overrides:
getParentDirectory in class javax.swing.filechooser.FileSystemView
Parameters:
directory - The directory being queried.
directory must be of type IFSJavaFile.
Returns:
the parent directory of specified directory, or null if specified directory is null.

getRoots

public java.io.File[] getRoots()
Returns all root partitions on this system.
The iSeries integrated file system has one root partition, the "/" directory.

Overrides:
getRoots in class javax.swing.filechooser.FileSystemView
Returns:
all root partitions on this system.

isHiddenFile

public boolean isHiddenFile(java.io.File file)
Returns whether a file is hidden or not.

Overrides:
isHiddenFile in class javax.swing.filechooser.FileSystemView
Returns:
true if the file is hidden.

isRoot

public boolean isRoot(java.io.File file)
Determines if the given file is a root in the navigatable tree(s).
The iSeries integrated file system has one root, the "/" directory.

Overrides:
isRoot in class javax.swing.filechooser.FileSystemView
Parameters:
file - A File object representing a directory.
Returns:
true if file is a root in the navigatable tree.