|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString
public class RemoteFileFilterString
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:
d:\mystuff\phil*.abc
phil*.abc
d:\mystuff\java,class,
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 java.lang.String |
file
|
protected boolean |
files
|
protected boolean |
filterByTypes
|
protected java.lang.String |
path
|
protected java.lang.String |
PATH_SEP
|
protected boolean |
subdirs
|
static java.lang.String |
SWITCH_NOFILES
|
static java.lang.String |
SWITCH_NOSUBDIRS
|
static char |
TYPE_SEP
|
static java.lang.String |
TYPE_SEP_STRING
|
protected java.lang.String[] |
types
|
Constructor Summary | |
---|---|
RemoteFileFilterString()
Constructor to use for a filter to list roots when used absolutely, or list all contents when used relatively. |
|
RemoteFileFilterString(IRemoteFileSubSystemConfiguration subsysFactory)
Constructor to use when there is no existing filter string. |
|
RemoteFileFilterString(IRemoteFileSubSystemConfiguration subsysFactory,
java.lang.String input)
Constructor to use when an absolute filter string already exists. |
|
RemoteFileFilterString(IRemoteFileSubSystemConfiguration subsysFactory,
java.lang.String path,
java.lang.String input)
Constructor to use when you have a path and filename filter or comma-separated file types list. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clone this into another filter string object with the same attributes. |
java.lang.String |
getFile()
Get the file name filter |
java.lang.String |
getFileOrTypes()
Return the file part of the filter string, without the path. |
boolean |
getFilterByTypes()
Return true if this filter string filters by file types versus by file name |
java.lang.String |
getPath()
Get the path to list files and/or folders in |
boolean |
getShowFiles()
Should the filter show individual files? |
boolean |
getShowSubDirs()
Subdirs allowed? |
java.lang.String[] |
getTypes()
Get the types to subset by, if specified. |
java.lang.String |
getTypesAsString()
For file types filters, returns the types as a string of concatenated types, comma-delimited. |
static java.lang.String |
getTypesString(java.lang.String[] typesArray)
Concatenate the given file types as a single string, each type comma-separated |
boolean |
listRoot()
This filter string represent a list-files-in-root filter string? |
boolean |
listRoots()
This filter string represent a list-roots filter string? |
protected void |
parse(java.lang.String inputPath,
java.lang.String input)
|
protected void |
parseFileOrTypes(java.lang.String filter)
Parse the non-folder part of the filter string. |
static java.lang.String[] |
parseTypes(java.lang.String typeList)
Parse a comma-separated list of strings into an array of strings |
void |
setFile(java.lang.String obj)
Set the file name filter. |
void |
setPath(java.lang.String path)
Set the path to list files and/or folders in |
void |
setShowFiles(boolean set)
Allow files? |
void |
setShowSubDirs(boolean set)
Allow subdirs? |
void |
setSubSystemConfiguration(IRemoteFileSubSystemConfiguration subsysFactory)
|
void |
setTypes(java.lang.String[] types)
Set the file types to subset by. |
java.lang.String |
toString()
Serialize into a string capturing all the attributes |
java.lang.String |
toStringNoSwitches()
Return the filter as a string, without the switches for no-files, no-folders |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String path
protected java.lang.String file
protected java.lang.String[] types
protected boolean subdirs
protected boolean files
protected boolean filterByTypes
protected java.lang.String PATH_SEP
public static final char TYPE_SEP
public static final java.lang.String TYPE_SEP_STRING
public static final java.lang.String SWITCH_NOSUBDIRS
public static final java.lang.String SWITCH_NOFILES
Constructor Detail |
---|
public RemoteFileFilterString()
public RemoteFileFilterString(IRemoteFileSubSystemConfiguration subsysFactory)
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.
setPath(String)
,
setFile(String)
,
setTypes(String[])
public RemoteFileFilterString(IRemoteFileSubSystemConfiguration subsysFactory, java.lang.String input)
public RemoteFileFilterString(IRemoteFileSubSystemConfiguration subsysFactory, java.lang.String path, java.lang.String input)
Method Detail |
---|
public void setSubSystemConfiguration(IRemoteFileSubSystemConfiguration subsysFactory)
public void setFile(java.lang.String obj)
public void setPath(java.lang.String path)
public void setTypes(java.lang.String[] types)
public void setShowFiles(boolean set)
public void setShowSubDirs(boolean set)
public java.lang.String getFile()
public java.lang.String getFileOrTypes()
public static java.lang.String getTypesString(java.lang.String[] typesArray)
public java.lang.String getTypesAsString()
public java.lang.String getPath()
public java.lang.String[] getTypes()
public boolean getShowFiles()
public boolean getShowSubDirs()
public boolean getFilterByTypes()
public boolean listRoots()
public boolean listRoot()
protected void parse(java.lang.String inputPath, java.lang.String input)
protected void parseFileOrTypes(java.lang.String filter)
public static java.lang.String[] parseTypes(java.lang.String typeList)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringNoSwitches()
public java.lang.Object clone()
clone
in class java.lang.Object
|
RSE Release 3.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |