Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.subsystems.shells.core.model
Class RemoteCommandFilterString


java.lang.Object
  extended by 
org.eclipse.rse.subsystems.shells.core.model.RemoteCommandFilterString
All Implemented Interfaces:
Cloneable

public class RemoteCommandFilterString
extends Object
implements Cloneable

A string representing a filter sent to remote file subsystems.

Filters can be absolute or relative. Absolute contains a folder path, while relative do not.

The files can be filtered by name, or by a list of file types. If by name, it can have up to 2 asterisks anywhere in the name for wildcarding. If by types, multiple types can by specified. The types are the file extensions without the dot, as in "java" or "class".

Examples:

  • Absolute file name filter: d:\mystuff\phil*.abc
  • Relative file name filter: phil*.abc
  • Absolute file type filter: d:\mystuff\java,class,
  • Relative file type filter: java,class,

    Syntactically, file type filter strings have at least one comma. Note that the file name filter string "*.java" is semantically the same as a type filter string "java,". Either one can be used and will get the same results. However, if you specify "java" you will be in trouble, as it will mean look for a file explicitly named "java".

    It is invalid to have both a comma and an asterisk in the same filter string. It is also invalid to have both a comma and a period in the same filter string.

    Clients may use or subclass this class. When subclassing, clients need to ensure that the subclass is always capable of performing a deep clone operation with the clone() method, so if they add fields of complex type, these need to be dealt with by overriding clone().


    Field Summary
    protected  boolean filterByTypes
               
    protected   String shellStr
               
    protected   String[] types
               
     
    Constructor Summary
    RemoteCommandFilterString ()
              Constructor to use for a filter to list roots when used absolutely, or list all contents when used relatively.
    RemoteCommandFilterString ( IRemoteCmdSubSystemConfiguration subsysFactory)
              Constructor to use when there is no existing filter string.
    RemoteCommandFilterString ( IRemoteCmdSubSystemConfiguration subsysFactory, String input)
              Constructor to use when an absolute filter string already exists.
    RemoteCommandFilterString ( IRemoteCmdSubSystemConfiguration subsysFactory, String path, String input)
              Constructor to use when you have a path and filename filter or comma-separated file types list.
     
    Method Summary
      Object clone ()
              Clone this into another filter string object with the same attributes.
     boolean getFilterByTypes ()
              Return true if this filter string filters by file types versus by file name
      String[] getTypes ()
              Get the types to subset by, if specified.
      String getTypesAsString ()
              For file types filters, returns the types as a string of concatenated types, comma-delimited.
    static  String getTypesString ( String[] typesArray)
              Concatenate the given file types as a single string, each type comma-separated
     void setSubSystemConfiguration ( IRemoteCmdSubSystemConfiguration subsysFactory)
               
     void setTypes ( String[] types)
              Set the file types to subset by.
      String toString ()
              Serialize into a string capturing all the attributes
     
    Methods inherited from class java.lang. Object
    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Field Detail

    shellStr

    protected 
    String shellStr
    

    types

    protected 
    String[] types
    

    filterByTypes

    protected boolean filterByTypes
    
    Constructor Detail

    RemoteCommandFilterString

    public RemoteCommandFilterString()
    Constructor to use for a filter to list roots when used absolutely, or list all contents when used relatively.


    RemoteCommandFilterString

    public RemoteCommandFilterString(
    IRemoteCmdSubSystemConfiguration subsysFactory)
    Constructor to use when there is no existing filter string.

    This constructor is better that the default constructor, because it takes a remote file subsystem factory, from which we can query the folder and path separator characters, which are needed to parse and re-build filter strings.

    See Also:
    setTypes(String[])

    RemoteCommandFilterString

    public RemoteCommandFilterString(
    IRemoteCmdSubSystemConfiguration subsysFactory,
                                     
    String input)
    Constructor to use when an absolute filter string already exists.


    RemoteCommandFilterString

    public RemoteCommandFilterString(
    IRemoteCmdSubSystemConfiguration subsysFactory,
                                     
    String path,
                                     
    String input)
    Constructor to use when you have a path and filename filter or comma-separated file types list. In the latter case, the last char must be a TYPE_SEP or comma, even for a single type.

    Method Detail

    setSubSystemConfiguration

    public void setSubSystemConfiguration(
    IRemoteCmdSubSystemConfiguration subsysFactory)

    setTypes

    public void setTypes(
    String[] types)
    Set the file types to subset by. These are extensions, without the dot, as in java, class, gif, etc. You either call this or setFile!


    getTypesString

    public static 
    String getTypesString(
    String[] typesArray)
    Concatenate the given file types as a single string, each type comma-separated


    getTypesAsString

    public 
    String getTypesAsString()
    For file types filters, returns the types as a string of concatenated types, comma-delimited. For file name filters, returns null;


    getTypes

    public 
    String[] getTypes()
    Get the types to subset by, if specified. Will be null if this is not a by-type filter string.


    getFilterByTypes

    public boolean getFilterByTypes()
    Return true if this filter string filters by file types versus by file name


    toString

    public 
    String toString()
    Serialize into a string capturing all the attributes

    Overrides:
    toString in class Object

    clone

    public 
    Object clone()
    Clone this into another filter string object with the same attributes. Subclasses must ensure that such a deep copy operation is always possible, so their state must always be cloneable. Which should always be possible to achieve, since this Object also needs to be serializable.

    Overrides:
    clone in class Object

    RSE
    Release 3.0

    Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire