org.apache.tools.ant.taskdefs.optional.starteam
public abstract class TreeBasedTask extends StarTeamTask
visit(Folder rootStarteamFolder, java.io.File rootLocalFolder)
Created: Sat Dec 15 16:55:19 2001
See Also: borland StarTeam Web Site
Nested Class Summary | |
---|---|
protected abstract class | TreeBasedTask.UnmatchedFileMap
This class implements a map of existing local files to possibly
existing repository files. |
Field Summary | |
---|---|
static String | DEFAULT_EXCLUDESETTING
This disables the exclude filter by default. |
static String | DEFAULT_INCLUDESETTING
This constant sets the filter to include all files. |
Method Summary | |
---|---|
void | execute()
This method does the work of opening the supplied Starteam view and
calling the visit() method to perform the task.
|
protected String | getAsOfDate()
return the asOfDate entered by the user for internal use by derived
classes.
|
String | getExcludes()
Gets the patterns from the exclude filter. |
static String | getFullRepositoryPath(File remotefile)
Return the full repository path name of a file. |
protected int | getIDofLabelInUse()
Get the id of the label in use. |
String | getIncludes()
Gets the patterns from the include filter. |
protected String | getLabel()
return the label passed to the task by the user as a string
|
protected int | getLabelID(View v)
Helper method calls on the StarTeam API to retrieve an ID number
for the specified view, corresponding to this.label. |
protected Label | getLabelInUse()
returns the label being used
|
String | getRootLocalFolder()
Returns the local folder specified by the user,
corresponding to the starteam folder for this operation
or null if not specified.
|
String | getRootStarteamFolder()
returns the root folder in the Starteam repository
used for this operation |
protected View | getViewConfiguredByDate(View raw)
If an asofDate parameter has been supplied by the user return a
StarTeam view based on the configuration of the StarTeam view
specified the user as of the date specified in the parameter.
|
boolean | isForced()
Get the value of forced. |
boolean | isPreloadFileInformation()
Get the value of preloadFileInformation. |
boolean | isRecursive()
Get the value of recursive. |
protected boolean | isUsingRevisionLabel()
returns true if a label has been specified and it is a revision label.
|
protected boolean | isUsingViewLabel()
returns true if a label has been specified and it is a view label.
|
protected void | logAsOfDate()
show the asofDate in the log |
protected void | logExcludes()
if excludes have been specified, emit the list to the log |
protected void | logIncludes()
if excludes have been specified, emit the list to the log |
protected void | logLabel()
show the label in the log and its type. |
protected abstract void | logOperationDescription(Folder starteamrootFolder, File targetrootFolder)
extenders should emit to the log an entry describing the parameters
that will be used by this operation.
|
protected boolean | matchPatterns(String patterns, String pName)
Convenience method to see if a string match a one pattern
in given set of space-separated patterns. |
void | setExcludes(String excludes)
Declare files to exclude using standard excludes patterns; optional.
|
void | setForced(boolean v)
Flag to force actions regardless of the status
that StarTeam is maintaining for the file; optional, default false.
|
void | setIncludes(String includes)
Declare files to include using standard includes patterns; optional. |
void | setPreloadFileInformation(boolean v)
Flag to set to preload file information from the server; optional,
default true.
|
void | setRecursive(boolean v)
Flag to set to include files in subfolders in the operation; optional,
default true. |
void | setRootLocalFolder(String rootLocalFolder)
Set the local folder that will be the root of the tree
to which files are checked out; optional.
|
void | setRootStarteamFolder(String rootStarteamFolder)
Set the root of the subtree in the StarTeam repository from which to
work; optional. |
protected boolean | shouldProcess(String pName)
Look if the file should be processed by the task.
|
protected abstract void | testPreconditions()
Derived classes must override this method to define tests for
any preconditons required by the task. |
protected abstract void | visit(Folder rootStarteamFolder, File rootLocalFolder)
Derived classes must override this class to define actual processing
to be performed on each folder in the tree defined for the task
|
protected void | _setAsOfDate(String asOfDate)
non-public method callable only by derived classes that implement
setAsOfDate (so that derived tasks that do not accept this
parameter will fail if user attempts to use it.
|
protected void | _setAsOfDateFormat(String asOfDateFormat)
non-public method callable only by derived classes that implement
setAsOfDateFormat (so that derived tasks that do not accept this
parameter will fail if user attempts to use it.
|
protected void | _setLabel(String label)
protected function to allow subclasses to set the label (or not).
sets the StarTeam label
|
setExcludes(null)
.
See Also: getExcludes TreeBasedTask
setIncludes("*")
.
See Also: getIncludes TreeBasedTask
visit()
method to perform the task.
Derived classes can customize the called methods
testPreconditions()
and visit()
.
Throws: BuildException if any error occurs in the processing
See Also: testPreconditions()
visit()
Returns: the asOfDate entered by the user
Since: Ant 1.6
Returns: A string of filter patterns separated by spaces.
See Also: TreeBasedTask TreeBasedTask getIncludes
Parameters: remotefile the Star Team file whose path is to be returned
Returns: the full repository path name of a file.
Returns: id of the label in use, if labelinuse is present, otherwise return null
Returns: A string of filter patterns separated by spaces.
See Also: TreeBasedTask TreeBasedTask getExcludes
Returns: the label passed to the task by the user as a string
Parameters: v the View
in which to search for this.label
Returns: the ID number corresponding to this.label
or -1 if
no label was provided.
Throws: BuildException if this.label
does not correspond
to any label in the supplied view
Returns: the label being used
Returns: the local folder that mirrors this.rootStarteamFolder
Returns: the root folder in use
createSnapshotView
abstract method.
Parameters: raw the raw view to be configured as of the supplied date
Returns: the view as configured.
Throws: BuildException thrown if the date is not parsable by the default or supplied format patterns.
Since: Ant 1.6
Returns: value of forced.
Returns: value of preloadFileInformation.
Returns: value of recursive.
Returns: true if a label has been specified and it is a revision label
Returns: true if a label has been specified and it is a view label
Since: Ant 1.6
Parameters: starteamrootFolder root folder in StarTeam for the operation targetrootFolder root local folder for the operation (whether specified by the user or not.
Parameters: patterns the space-separated list of patterns. pName the name to look for matching.
Returns: whether the name match at least one pattern.
DirectoryScanner
's
match
method, so here are the patterns straight from the
Ant source code:
setExcludes("*.XML,*.HTML");
Finally, note that filters have no effect on the directories
that are scanned; you could not skip over all files in directories
whose names begin with "project," for instance.
Parameters: excludes A string of filter patterns to exclude. Separate the patterns by spaces.
See Also: TreeBasedTask getIncludes getExcludes
Parameters: v Value to assign to forced.
Parameters: includes A string of filter patterns to include. Separate the patterns by spaces.
See Also: getIncludes TreeBasedTask getExcludes
Parameters: v Value to assign to preloadFileInformation.
Parameters: v Value to assign to recursive.
Parameters: rootLocalFolder the local folder that will mirror this.rootStarteamFolder
Parameters: rootStarteamFolder the root folder
Parameters: pName the item name to look for being included.
Returns: whether the file should be processed or not.
Throws: BuildException throw if any fatal error exists in the parameters supplied. If there is a non-fatal condition, just writing to the log may be appropriate.
See Also: execute()
Parameters: rootStarteamFolder the StarTeam folderto be visited rootLocalFolder the local mapping of rootStarteamFolder
Throws: BuildException on error
Parameters: asOfDate asOfDate entered by user.
Since: Ant 1.6
Parameters: asOfDateFormat asOfDate format entered by user.
Since: Ant 1.6
Parameters: label name of the StarTeam label to be set