Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.comm.filters
Class ISeriesIFSFilterString

java.lang.Object
  extended by com.ibm.etools.iseries.comm.filters.ISeriesAbstractFilterString
      extended by com.ibm.etools.iseries.comm.filters.ISeriesIFSFilterString

public class ISeriesIFSFilterString
extends ISeriesAbstractFilterString

A class representing an AS/400 Integrated File System (IFS) filter string. This is a path and name pattern for listing contents of an IFS folder. Getting a list requires a fully qualified path, relative to the root folder, and a generic file name pattern for subsetting the contents of the folder. It is also possible to explicitly exclude subfolders or files from the returned list. All this information can be specified by calling the setPath(String), and setFile(String) methods, and the setShowSubDirs(boolean) and setShowFiles(boolean) methods. Alternatively, it can be set by passing in a filter string in the constructor. Filter strings for IFS lists are of the form: /path/file -nf -ns where path is a forward-slash separated qualified folder name, and file is a generic name pattern used to subset the returned list of contents of the folder. The -nf and -ns switches are optional and if specified exclude files and subfolders from the returned list, respectively. They cannot be specified together, or you will get an empty list back! Note the terms folder and directory are used interchangeably in this documentation. To get the actual filter string from objects of this class, just call toString(). Objects of this class are used in the ISeriesListIFS class for returning a list of information about each IFS folder or file meeting the filter's criteria.

See Also:
ISeriesListIFS

Field Summary
static String Copyright
           
static String PATH_SEP
           
static String SWITCH_NOFILES
           
static String SWITCH_NOSUBDIRS
           
 
Fields inherited from class com.ibm.etools.iseries.comm.filters.ISeriesAbstractFilterString
QUOTE, WILDCARD
 
Constructor Summary
ISeriesIFSFilterString()
          Constructor to use when there is no existing filter string.
ISeriesIFSFilterString(String input)
          Constructor to use when filter string already exists.
ISeriesIFSFilterString(String rootPath, String input)
          Constructor to use when you have a path and relative filter.
 
Method Summary
 String getFile()
          Return the file part of the filter.
 String getPath()
          Return the path part of the filter.
 boolean getShowFiles()
          Return files in the list of contents? Specify true or false here to set it.
 boolean getShowSubDirs()
          Subdirs allowed?
 boolean isGeneric()
          Returns true if current filter represents a generic name or vs a scalar name.
 boolean isMultiGeneric()
          Returns true if current filter represents a generic name that has more than one generic name part.
protected  void parse(String input)
          Private method to parse filter string.
 void setFile(String obj)
          Set the file part of the filter.
 void setPath(String path)
          Set the path part of the filter.
 void setShowFiles(boolean set)
          Allow files?
 void setShowSubDirs(boolean set)
          Return sub folders in the list of contents? Specify true or false here to set it.
 String toString()
          Convert this filter into a filter string.
 String toStringNoOptions()
          Convert this filter into a filter string, but do not return the -nf or -ns switches.
 
Methods inherited from class com.ibm.etools.iseries.comm.filters.ISeriesAbstractFilterString
addQuotes, clone, countHostOccurrencesOf, countOccurrencesOf, createFilterStringObject, equals, hashCode, hostIndexOf, hostIndexOf, isGenericLibraryName, isGenericName, isQuoted, stripQuotes, verifyGenericName, verifyGenericNameAdvanced, verifyGenericNameAdvancedQuoted, verifyGenericNameQuoted
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

PATH_SEP

public static final String PATH_SEP
See Also:
Constant Field Values

SWITCH_NOSUBDIRS

public static final String SWITCH_NOSUBDIRS
See Also:
Constant Field Values

SWITCH_NOFILES

public static final String SWITCH_NOFILES
See Also:
Constant Field Values
Constructor Detail

ISeriesIFSFilterString

public ISeriesIFSFilterString()
Constructor to use when there is no existing filter string. This results in a default filter of /* , which means list all folders and files in the root directory. To change any of the default values, after instantiation call:
  • setPath(String) to set the path name.
  • setFile(String) to set the file name filter. This can be a simple or generic name.
  • setShowSubDirs(boolean) to explicitly include/exclude subfolders from the returned list. The default is true, include.
  • setShowFiles(boolean) to explicitly include/exclude files from the returned list. The default is true, include. Valid generic names have asterisks and/or question marks. An asterisk matches multiple characters while a question mark matches a single character only. A single asterisk means all.


  • ISeriesIFSFilterString

    public ISeriesIFSFilterString(String input)
    Constructor to use when filter string already exists. Filter strings for IFS lists are of the form: /path/file -nf -ns where path is a forward-slash separated qualified folder name, and file is a generic name pattern used to subset the returned list of contents of the folder. The -nf and -ns switches are optional and if specified exclude files and subfolders from the returned list, respectively. They cannot be specified together, or you will get an empty list back! To get the actual filter string from object of this class, just call toString().


    ISeriesIFSFilterString

    public ISeriesIFSFilterString(String rootPath,
                                  String input)
    Constructor to use when you have a path and relative filter. The relative filter is a combination of relative path and a file name pattern. The relative filter is appended to the rootPath to get the final result.

    Method Detail

    parse

    protected void parse(String input)
    Private method to parse filter string.


    getPath

    public String getPath()
    Return the path part of the filter. Always ends in "/".


    getFile

    public String getFile()
    Return the file part of the filter.


    setPath

    public void setPath(String path)
    Set the path part of the filter.


    setFile

    public void setFile(String obj)
    Set the file part of the filter. This is a scalar or generic name pattern.


    setShowSubDirs

    public void setShowSubDirs(boolean set)
    Return sub folders in the list of contents? Specify true or false here to set it.


    getShowSubDirs

    public boolean getShowSubDirs()
    Subdirs allowed?


    getShowFiles

    public boolean getShowFiles()
    Return files in the list of contents? Specify true or false here to set it.


    setShowFiles

    public void setShowFiles(boolean set)
    Allow files?


    toString

    public String toString()
    Convert this filter into a filter string. Filter strings for IFS lists are of the form: /path/file -nf -ns where path is a forward-slash separated qualified folder name, and file is a generic name pattern used to subset the returned list of contents of the folder. The -nf and -ns switches are optional and if specified exclude files and subfolders from the returned list, respectively. They cannot be specified together, or you will get an empty list back!

    Specified by:
    toString in class ISeriesAbstractFilterString

    toStringNoOptions

    public String toStringNoOptions()
    Convert this filter into a filter string, but do not return the -nf or -ns switches.


    isGeneric

    public boolean isGeneric()
    Returns true if current filter represents a generic name or vs a scalar name.

    Specified by:
    isGeneric in class ISeriesAbstractFilterString

    isMultiGeneric

    public boolean isMultiGeneric()
    Returns true if current filter represents a generic name that has more than one generic name part. For example, a multi-generic filter might ask to list all files that end in .java, in all folders that start with a*. NOT CLEAR IF IFS SUPPORTS THIS! TODO

    Specified by:
    isMultiGeneric in class ISeriesAbstractFilterString

    Rational Developer for Power Systems Software
    V7.6

    Copyright © 2011 IBM Corp. All Rights Reserved.

    Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.