org.apache.tools.ant.taskdefs.optional.starteam
Class StarTeamCheckout

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by org.apache.tools.ant.taskdefs.optional.starteam.StarTeamTask
              extended by org.apache.tools.ant.taskdefs.optional.starteam.TreeBasedTask
                  extended by org.apache.tools.ant.taskdefs.optional.starteam.StarTeamCheckout
All Implemented Interfaces:
java.lang.Cloneable

public class StarTeamCheckout
extends TreeBasedTask

Checks out files from a StarTeam project. It also creates all working directories on the local directory if appropriate. Ant Usage:

 <taskdef name="starteamcheckout"
 classname="org.apache.tools.ant.taskdefs.StarTeamCheckout"/>
 <starteamcheckout username="BuildMaster" password="ant" starteamFolder="Source"
 starteamurl="servername:portnum/project/view"
 createworkingdirectories="true"/>
 

Version:
1.1
See Also:
borland StarTeam Web Site

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.tools.ant.taskdefs.optional.starteam.TreeBasedTask
TreeBasedTask.UnmatchedFileMap
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.taskdefs.optional.starteam.TreeBasedTask
DEFAULT_EXCLUDESETTING, DEFAULT_INCLUDESETTING
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
StarTeamCheckout()
           
 
Method Summary
protected  com.starbase.starteam.View createSnapshotView(com.starbase.starteam.View raw)
          Override of base-class abstract function creates an appropriately configured view for checkouts - either the current view or a view from this.label or the raw view itself in the case of a revision label.
 boolean getUseRepositoryTimeStamp()
          returns the value of the useRepositoryTimestamp member
protected  void logOperationDescription(com.starbase.starteam.Folder starteamrootFolder, java.io.File targetrootFolder)
          extenders should emit to the log an entry describing the parameters that will be used by this operation.
 void setAsOfDate(java.lang.String asOfDateParam)
          List files, dates, and statuses as of this date; optional.
 void setAsOfDateFormat(java.lang.String asOfDateFormat)
          Date Format with which asOfDate parameter to be parsed; optional.
 void setConvertEOL(boolean value)
          Set whether or not files should be checked out using the local machine's EOL convention.
 void setCreateWorkingDirs(boolean value)
          flag (defaults to true) to create all directories that are in the Starteam repository even if they are empty.
 void setDeleteUncontrolled(boolean value)
          Whether or not all local files not in StarTeam should be deleted.
 void setLabel(java.lang.String label)
          Sets the label StarTeam is to use for checkout; defaults to the most recent file.
 void setLocked(boolean v)
          Set to do a locked checkout; optional default is false.
 void setUnlocked(boolean v)
          Set to do an unlocked checkout.
 void setUseRepositoryTimeStamp(boolean useRepositoryTimeStamp)
          sets the useRepositoryTimestmp member.
protected  void testPreconditions()
          Implements base-class abstract function to define tests for any preconditons required by the task.
protected  void visit(com.starbase.starteam.Folder starteamFolder, java.io.File targetFolder)
          Implements base-class abstract function to perform the checkout operation on the files in each folder of the tree.
 
Methods inherited from class org.apache.tools.ant.taskdefs.optional.starteam.TreeBasedTask
_setAsOfDate, _setAsOfDateFormat, _setLabel, execute, getAsOfDate, getExcludes, getFullRepositoryPath, getIDofLabelInUse, getIncludes, getLabel, getLabelID, getLabelInUse, getRootLocalFolder, getRootStarteamFolder, getViewConfiguredByDate, isForced, isPreloadFileInformation, isRecursive, isUsingRevisionLabel, isUsingViewLabel, logAsOfDate, logExcludes, logIncludes, logLabel, matchPatterns, setExcludes, setForced, setIncludes, setPreloadFileInformation, setRecursive, setRootLocalFolder, setRootStarteamFolder, shouldProcess
 
Methods inherited from class org.apache.tools.ant.taskdefs.optional.starteam.StarTeamTask
disconnectFromServer, getPassword, getProjectname, getServer, getServername, getServerport, getTypeNames, getURL, getUserName, getUserName, getViewname, getViewURL, openView, setPassword, setProjectname, setServername, setServerport, setURL, setUserName, setViewname
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StarTeamCheckout

public StarTeamCheckout()
Method Detail

setCreateWorkingDirs

public void setCreateWorkingDirs(boolean value)
flag (defaults to true) to create all directories that are in the Starteam repository even if they are empty.

Parameters:
value - the value to set the attribute to.

setDeleteUncontrolled

public void setDeleteUncontrolled(boolean value)
Whether or not all local files not in StarTeam should be deleted. Optional, defaults to true.

Parameters:
value - the value to set the attribute to.

setConvertEOL

public void setConvertEOL(boolean value)
Set whether or not files should be checked out using the local machine's EOL convention. Optional, defaults to true.

Parameters:
value - the value to set the attribute to.

setLabel

public void setLabel(java.lang.String label)
Sets the label StarTeam is to use for checkout; defaults to the most recent file. The label must exist in starteam or an exception will be thrown.

Parameters:
label - the label to be used

setLocked

public void setLocked(boolean v)
               throws BuildException
Set to do a locked checkout; optional default is false.

Parameters:
v - True to do a locked checkout, false to checkout without changing status/.
Throws:
BuildException - if both locked and unlocked are set true

setUnlocked

public void setUnlocked(boolean v)
                 throws BuildException
Set to do an unlocked checkout. Default is false;

Parameters:
v - True to do an unlocked checkout, false to checkout without changing status.
Throws:
BuildException - if both locked and unlocked are set true

setUseRepositoryTimeStamp

public void setUseRepositoryTimeStamp(boolean useRepositoryTimeStamp)
sets the useRepositoryTimestmp member.

Parameters:
useRepositoryTimeStamp - true means checked out files will get the repository timestamp. false means the checked out files will be timestamped at the time of checkout.

getUseRepositoryTimeStamp

public boolean getUseRepositoryTimeStamp()
returns the value of the useRepositoryTimestamp member

Returns:
the value of the useRepositoryTimestamp member

setAsOfDate

public void setAsOfDate(java.lang.String asOfDateParam)
List files, dates, and statuses as of this date; optional. If not specified, the most recent version of each file will be listed.

Parameters:
asOfDateParam - the date as of which the listing to be made
Since:
Ant 1.6

setAsOfDateFormat

public void setAsOfDateFormat(java.lang.String asOfDateFormat)
Date Format with which asOfDate parameter to be parsed; optional. Must be a SimpleDateFormat compatible string. If not specified, and asOfDateParam is specified, parse will use ISO8601 datetime and date formats.

Parameters:
asOfDateFormat - the SimpleDateFormat-compatible format string
Since:
Ant 1.6

createSnapshotView

protected com.starbase.starteam.View createSnapshotView(com.starbase.starteam.View raw)
                                                 throws BuildException
Override of base-class abstract function creates an appropriately configured view for checkouts - either the current view or a view from this.label or the raw view itself in the case of a revision label.

Specified by:
createSnapshotView in class StarTeamTask
Parameters:
raw - the unconfigured View
Returns:
the snapshot View appropriately configured.
Throws:
BuildException - on error

testPreconditions

protected void testPreconditions()
                          throws BuildException
Implements base-class abstract function to define tests for any preconditons required by the task.

Specified by:
testPreconditions in class TreeBasedTask
Throws:
BuildException - thrown if both rootLocalFolder and viewRootLocalFolder are defined
See Also:
execute()

logOperationDescription

protected void logOperationDescription(com.starbase.starteam.Folder starteamrootFolder,
                                       java.io.File targetrootFolder)
extenders should emit to the log an entry describing the parameters that will be used by this operation.

Specified by:
logOperationDescription in class TreeBasedTask
Parameters:
starteamrootFolder - root folder in StarTeam for the operation
targetrootFolder - root local folder for the operation (whether specified by the user or not.

visit

protected void visit(com.starbase.starteam.Folder starteamFolder,
                     java.io.File targetFolder)
              throws BuildException
Implements base-class abstract function to perform the checkout operation on the files in each folder of the tree.

Specified by:
visit in class TreeBasedTask
Parameters:
starteamFolder - the StarTeam folder from which files to be checked out
targetFolder - the local mapping of rootStarteamFolder
Throws:
BuildException - if any error occurs