com.ibm.as400.vaccess
Class IFSFileSystemView
- java.lang.Object
-
- javax.swing.filechooser.FileSystemView
-
- com.ibm.as400.vaccess.IFSFileSystemView
-
Deprecated.Use com.ibm.as400.access.IFSSystemView instead.
public class IFSFileSystemView extends javax.swing.filechooser.FileSystemView
Provides a gateway to the IBM i 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.
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()); }
- See Also:
IFSFileDialog
,IFSJavaFile
-
-
Constructor Summary
Constructors Constructor and Description IFSFileSystemView(AS400 system)
Deprecated.Constructs an IFSFileSystemView object.
-
Method Summary
Methods 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).
-
-
-
Constructor Detail
-
IFSFileSystemView
public IFSFileSystemView(AS400 system)
Deprecated.Constructs an IFSFileSystemView object.- Parameters:
system
- The system that contains the file.
-
-
Method Detail
-
createFileObject
public java.io.File createFileObject(java.io.File containingDir, java.lang.String name)
Deprecated.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 classjavax.swing.filechooser.FileSystemView
- Parameters:
containingDir
- The directory in which to create the file.
containingDir is assumed to represent an existing directory on the system. If null, it is ignored.name
- The file name.- Returns:
- a File object representing the new file.
-
createFileObject
public java.io.File createFileObject(java.lang.String path)
Deprecated.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 classjavax.swing.filechooser.FileSystemView
- Parameters:
path
- The file path name.- Returns:
- the File object.
-
createFileSystemRoot
protected java.io.File createFileSystemRoot(java.io.File f)
Deprecated.- Overrides:
createFileSystemRoot
in classjavax.swing.filechooser.FileSystemView
-
createNewFolder
public java.io.File createNewFolder(java.io.File containingDir) throws java.io.IOException
Deprecated.Creates a new folder with a default name.
Note: In the context of this class, "folder" is synonymous with "directory".- Specified by:
createNewFolder
in classjavax.swing.filechooser.FileSystemView
- Parameters:
containingDir
- The parent directory in which to create the folder.
containingDir is assumed to represent an existing directory on the system.- Returns:
- a File object representing the new folder.
- Throws:
java.io.IOException
-
getDefaultDirectory
public java.io.File getDefaultDirectory()
Deprecated.Returns the user's default starting directory for the file chooser. This will represent the 'root' directory on the system.- Overrides:
getDefaultDirectory
in classjavax.swing.filechooser.FileSystemView
- Returns:
- A
File
object representing the default starting folder.
-
getFiles
public java.io.File[] getFiles(java.io.File directory, boolean useFileHiding)
Deprecated.Gets the list of shown (that is, not hidden) files in the directory.- Overrides:
getFiles
in classjavax.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()
Deprecated.Returns the home directory.
The IBM i integrated file system has one home directory, the "/" directory.- Overrides:
getHomeDirectory
in classjavax.swing.filechooser.FileSystemView
- Returns:
- the home directory.
-
getParentDirectory
public java.io.File getParentDirectory(java.io.File dir)
Deprecated.Returns the parent directory of dir.- Overrides:
getParentDirectory
in classjavax.swing.filechooser.FileSystemView
- Parameters:
dir
- The directory being queried.
dir is assumed to represent an existing directory on the system.- Returns:
- the parent directory of dir, or null if dir is null.
-
getRoots
public java.io.File[] getRoots()
Deprecated.Returns all root partitions on this system.
The IBM i integrated file system has one root partition, the "/" directory.- Overrides:
getRoots
in classjavax.swing.filechooser.FileSystemView
- Returns:
- all root partitions on this system.
-
getSystemDisplayName
public 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.- Overrides:
getSystemDisplayName
in classjavax.swing.filechooser.FileSystemView
- Parameters:
f
- AFile
object.- Returns:
- The file name as it would be displayed by a native file chooser.
-
getSystemIcon
public javax.swing.Icon getSystemIcon(java.io.File f)
Deprecated.Always returns an icon representing an IBM i system.- Overrides:
getSystemIcon
in classjavax.swing.filechooser.FileSystemView
-
getSystemTypeDescription
public 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.- Overrides:
getSystemTypeDescription
in classjavax.swing.filechooser.FileSystemView
- Parameters:
f
- AFile
object.- Returns:
- The file type description as it would be displayed by a native file chooser or null if no native information is available.
-
isComputerNode
public boolean isComputerNode(java.io.File dir)
Deprecated.Always returns false.- Overrides:
isComputerNode
in classjavax.swing.filechooser.FileSystemView
-
isDrive
public boolean isDrive(java.io.File dir)
Deprecated.Always returns false.- Overrides:
isDrive
in classjavax.swing.filechooser.FileSystemView
-
isFloppyDrive
public boolean isFloppyDrive(java.io.File dir)
Deprecated.Always returns false.- Overrides:
isFloppyDrive
in classjavax.swing.filechooser.FileSystemView
-
isFileSystemRoot
public boolean isFileSystemRoot(java.io.File f)
Deprecated.Returns true if f represents the root directory on the system ("/"), and false otherwise.- Overrides:
isFileSystemRoot
in classjavax.swing.filechooser.FileSystemView
- Parameters:
f
- AFile
object representing a directory.- Returns:
true
iff
is a root of a filesystem
-
isRoot
public boolean isRoot(java.io.File file)
Deprecated.Determines if the given file is a root in the navigatable tree(s).
The IBM i integrated file system has one root, the "/" directory.- Overrides:
isRoot
in classjavax.swing.filechooser.FileSystemView
- Parameters:
file
- A File object representing a directory.- Returns:
- true if file is a root in the navigatable tree.
-
-