public class IFSFileSystemView
extends javax.swing.filechooser.FileSystemView
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.
import com.ibm.as400.access.AS400;
import com.ibm.as400.access.IFSJavaFile;
import com.ibm.as400.vaccess.IFSFileSystemView;
import javax.swing.JFileChooser;
import java.awt.Frame;
// Work with directory /Dir on the system myAS400.
AS400 system = new AS400("myAS400");
IFSJavaFile dir = new IFSJavaFile(system, "/Dir");
JFileChooser chooser = new JFileChooser(dir, new IFSFileSystemView(system));
Frame parent = new Frame();
int returnVal = chooser.showOpenDialog(parent);
if (returnVal == JFileChooser.APPROVE_OPTION) {
IFSJavaFile chosenFile = (IFSJavaFile)(chooser.getSelectedFile());
System.out.println("You selected the file named " +
chosenFile.getName());
}
IFSFileDialog,
IFSJavaFile| Constructor and Description |
|---|
IFSFileSystemView(AS400 system)
Deprecated.
Constructs an IFSFileSystemView object.
|
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
createFileObject(java.io.File containingDir,
java.lang.String name)
Deprecated.
Returns a File object constructed in directory from the given filename.
|
java.io.File |
createFileObject(java.lang.String path)
Deprecated.
Returns a File object constructed from the given path string.
|
protected java.io.File |
createFileSystemRoot(java.io.File f)
Deprecated.
|
java.io.File |
createNewFolder(java.io.File containingDir)
Deprecated.
Creates a new folder with a default name.
|
java.io.File |
getDefaultDirectory()
Deprecated.
Returns the user's default starting directory for the file chooser.
|
java.io.File[] |
getFiles(java.io.File directory,
boolean useFileHiding)
Deprecated.
Gets the list of shown (that is, not hidden) files in the directory.
|
java.io.File |
getHomeDirectory()
Deprecated.
Returns the home directory.
|
java.io.File |
getParentDirectory(java.io.File dir)
Deprecated.
Returns the parent directory of dir.
|
java.io.File[] |
getRoots()
Deprecated.
Returns all root partitions on this system.
|
java.lang.String |
getSystemDisplayName(java.io.File f)
Deprecated.
Returns the name of a file, directory, or folder as it would be displayed in
a system file browser.
|
javax.swing.Icon |
getSystemIcon(java.io.File f)
Deprecated.
Always returns an icon representing an IBM i system.
|
java.lang.String |
getSystemTypeDescription(java.io.File f)
Deprecated.
Returns a type description for a file, directory, or folder as it would be displayed in
a system file browser.
|
boolean |
isComputerNode(java.io.File dir)
Deprecated.
Always returns false.
|
boolean |
isDrive(java.io.File dir)
Deprecated.
Always returns false.
|
boolean |
isFileSystemRoot(java.io.File f)
Deprecated.
Returns true if f represents the root directory on the system ("/"),
and false otherwise.
|
boolean |
isFloppyDrive(java.io.File dir)
Deprecated.
Always returns false.
|
boolean |
isRoot(java.io.File file)
Deprecated.
Determines if the given file is a root in the navigatable tree(s).
|
public IFSFileSystemView(AS400 system)
system - The system that contains the file.public java.io.File createFileObject(java.io.File containingDir,
java.lang.String name)
createFileObject in class javax.swing.filechooser.FileSystemViewcontainingDir - The directory in which to create the file.
name - The file name.public java.io.File createFileObject(java.lang.String path)
createFileObject in class javax.swing.filechooser.FileSystemViewpath - The file path name.protected java.io.File createFileSystemRoot(java.io.File f)
createFileSystemRoot in class javax.swing.filechooser.FileSystemViewpublic java.io.File createNewFolder(java.io.File containingDir)
throws java.io.IOException
createNewFolder in class javax.swing.filechooser.FileSystemViewcontainingDir - The parent directory in which to create the folder.
java.io.IOExceptionpublic java.io.File getDefaultDirectory()
getDefaultDirectory in class javax.swing.filechooser.FileSystemViewFile object representing the default
starting folder.public java.io.File[] getFiles(java.io.File directory,
boolean useFileHiding)
getFiles in class javax.swing.filechooser.FileSystemViewdirectory - The directory to search.useFileHiding - This parameter is ignored.public java.io.File getHomeDirectory()
getHomeDirectory in class javax.swing.filechooser.FileSystemViewpublic java.io.File getParentDirectory(java.io.File dir)
getParentDirectory in class javax.swing.filechooser.FileSystemViewdir - The directory being queried.
public java.io.File[] getRoots()
getRoots in class javax.swing.filechooser.FileSystemViewpublic java.lang.String getSystemDisplayName(java.io.File f)
getSystemDisplayName in class javax.swing.filechooser.FileSystemViewf - A File object.public javax.swing.Icon getSystemIcon(java.io.File f)
getSystemIcon in class javax.swing.filechooser.FileSystemViewpublic java.lang.String getSystemTypeDescription(java.io.File f)
getSystemTypeDescription in class javax.swing.filechooser.FileSystemViewf - A File object.public boolean isComputerNode(java.io.File dir)
isComputerNode in class javax.swing.filechooser.FileSystemViewpublic boolean isDrive(java.io.File dir)
isDrive in class javax.swing.filechooser.FileSystemViewpublic boolean isFloppyDrive(java.io.File dir)
isFloppyDrive in class javax.swing.filechooser.FileSystemViewpublic boolean isFileSystemRoot(java.io.File f)
isFileSystemRoot in class javax.swing.filechooser.FileSystemViewf - A File object representing a directory.true if f is a root of a filesystempublic boolean isRoot(java.io.File file)
isRoot in class javax.swing.filechooser.FileSystemViewfile - A File object representing a directory.