com.sas.swing.models.remotefileselector.ifileservice
Class IFileServiceModel

com.sas.swing.models.remotefileselector.ifileservice.IFileServiceModel
All Implemented Interfaces:
RemoteFileServiceModelInterface, WorkspacePropertyInterface
Direct Known Subclasses:
IFileServiceSearchModel

public class IFileServiceModel
implements RemoteFileServiceModelInterface, WorkspacePropertyInterface

IFileServiceModel defines the model that communicates with the IOM IFileService.

Since:
3.1
See Also:
com.sas.swing.visuals.remotefileselector.RemoteFileServerModel,

Field Summary
static int MVS_HFS_FILESYSTEM
          specifies to use the HFS file system when connected to an MVS host
static int MVS_OS_FILESYSTEM
          specifies to use the MVS file system when connected to an MVS host
static java.lang.String RB_KEY
          identifies the resource key
 
Constructor Summary
IFileServiceModel()
          Default constructor.
IFileServiceModel(com.sas.iom.SAS.IWorkspace workspace)
          Allows specification of a workspace object used to connect to the host system.
IFileServiceModel(com.sas.iom.SAS.IWorkspace workspace, int fileSystem)
          Allows specification of a workspace object used to connect to the host system and, if the host is MVS, the file system to be used.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener.
 java.lang.String combineDirectoryPathAndFileName(java.lang.String path, java.lang.String name)
          Concatenates a path and a folder or file name.
 java.lang.String getDirectoryPath(java.lang.String path)
          Returns a path for the file locations.
 java.util.List getFiles(java.lang.String path)
          Returns the collection of files for file system path that is to be viewed.
 java.util.List getFilterValues()
          Returns the currently set values to filter on.
 java.lang.String getFullyQualifiedPath(java.lang.String currentPath, java.lang.String fileName)
          Returns the file system path.
 java.lang.String getTopLevelName()
          Returns a name used to identify the top level in the view.
 com.sas.iom.SAS.IWorkspace getWorkspace()
          Returns the workspace used to communicate with the file system.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener.
 void setFilterValues(java.util.List filterValues)
          Sets a list of values to be used for filtering file types or extensions.
 void setWorkspace(com.sas.iom.SAS.IWorkspace workspace)
          Sets the workspace to be used to communicate with the file system.
 java.lang.String[] splitDirectoryPathAndFileName(java.lang.String path)
          Parses a given path into the parent directory and the folder name.
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
identifies the resource key

See Also:
Constant Field Values

MVS_OS_FILESYSTEM

public static int MVS_OS_FILESYSTEM
specifies to use the MVS file system when connected to an MVS host


MVS_HFS_FILESYSTEM

public static int MVS_HFS_FILESYSTEM
specifies to use the HFS file system when connected to an MVS host

Constructor Detail

IFileServiceModel

public IFileServiceModel()
Default constructor.


IFileServiceModel

public IFileServiceModel(com.sas.iom.SAS.IWorkspace workspace)
Allows specification of a workspace object used to connect to the host system. If the host is MVS, then the HFS file system is specified as the default.

Parameters:
workspace - the workspace used to connect to the file system

IFileServiceModel

public IFileServiceModel(com.sas.iom.SAS.IWorkspace workspace,
                         int fileSystem)
Allows specification of a workspace object used to connect to the host system and, if the host is MVS, the file system to be used.

Parameters:
workspace - the workspace used to connect to the file system
fileSystem - the file system to be used when connected to an MVS host
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener.

Specified by:
addPropertyChangeListener in interface RemoteFileServiceModelInterface
Parameters:
listener - the PropertyChangeListener

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener.

Specified by:
removePropertyChangeListener in interface RemoteFileServiceModelInterface
Parameters:
listener - the PropertyChangeListener

getFiles

public java.util.List getFiles(java.lang.String path)
                        throws java.lang.IllegalArgumentException
Returns the collection of files for file system path that is to be viewed. Passing an empty or null string is treated as specifying the root directory. Other values need to be formatted for the appropriate host operating system. This method returns a collection of files . Each member of this collection is an instance of com.sas.swing.models.remotefileselector.ifileservice.IFileServiceFileMetadata class.

Specified by:
getFiles in interface RemoteFileServiceModelInterface
Parameters:
path - the file system path.
Returns:
the collection of files
Throws:
java.lang.IllegalArgumentException
See Also:
RemoteFileMetadataInterface, IFileServiceFileMetadata

splitDirectoryPathAndFileName

public java.lang.String[] splitDirectoryPathAndFileName(java.lang.String path)
Parses a given path into the parent directory and the folder name.

Specified by:
splitDirectoryPathAndFileName in interface RemoteFileServiceModelInterface
Parameters:
path - the path to be parsed
Returns:
the folder and parent directory

combineDirectoryPathAndFileName

public java.lang.String combineDirectoryPathAndFileName(java.lang.String path,
                                                        java.lang.String name)
Concatenates a path and a folder or file name.

Specified by:
combineDirectoryPathAndFileName in interface RemoteFileServiceModelInterface
Parameters:
path - the parent path
name - the name to be appended
Returns:
the concatenated path

getTopLevelName

public java.lang.String getTopLevelName()
Returns a name used to identify the top level in the view.

Specified by:
getTopLevelName in interface RemoteFileServiceModelInterface
Returns:
the display name of the top level

getFullyQualifiedPath

public java.lang.String getFullyQualifiedPath(java.lang.String currentPath,
                                              java.lang.String fileName)
Returns the file system path. The form of the path is the same as the file system.

Specified by:
getFullyQualifiedPath in interface RemoteFileServiceModelInterface
Parameters:
currentPath - the original path that needs to be fully qualified
Returns:
the file system path

getDirectoryPath

public java.lang.String getDirectoryPath(java.lang.String path)
Returns a path for the file locations. Does not include extraneous system information.

Specified by:
getDirectoryPath in interface RemoteFileServiceModelInterface
Parameters:
path - the fully qualified path
Returns:
the file locations path

setFilterValues

public void setFilterValues(java.util.List filterValues)
Sets a list of values to be used for filtering file types or extensions.

Specified by:
setFilterValues in interface RemoteFileServiceModelInterface
Parameters:
filterValues - a List of String items with the values
See Also:
getFilterValues()

getFilterValues

public java.util.List getFilterValues()
Returns the currently set values to filter on.

Specified by:
getFilterValues in interface RemoteFileServiceModelInterface
Returns:
List of String items
See Also:
setFilterValues(List)

getWorkspace

public com.sas.iom.SAS.IWorkspace getWorkspace()
Returns the workspace used to communicate with the file system.

Specified by:
getWorkspace in interface WorkspacePropertyInterface
Returns:
a workspace
See Also:
setWorkspace(IWorkspace)

setWorkspace

public void setWorkspace(com.sas.iom.SAS.IWorkspace workspace)
Sets the workspace to be used to communicate with the file system.

Specified by:
setWorkspace in interface WorkspacePropertyInterface
Parameters:
workspace - a workspace
See Also:
getWorkspace()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.