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

java.lang.Object
  |
  +--org.apache.tools.ant.ProjectComponent
        |
        +--org.apache.tools.ant.Task
              |
              +--org.apache.tools.ant.taskdefs.optional.starteam.StarTeamTask
                    |
                    +--org.apache.tools.ant.taskdefs.optional.starteam.TreeBasedTask
                          |
                          +--org.apache.tools.ant.taskdefs.optional.starteam.StarTeamCheckout

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
Author:
Christopher Charlier, ThoughtWorks, Inc. 2001
, Jason Yip , Jason Pettiss , Steve Cohen
See Also:
StarBase Web Site

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
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
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.
 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)
          Should all all local files not in StarTeam be deleted? Optional, defaults to "true".
 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.
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
_setLabel, delistLocalFile, execute, getExcludes, getIncludes, getLabelID, getRootLocalFolder, getRootStarteamFolder, isForced, isRecursive, listLocalFiles, matchPatterns, setExcludes, setForced, setIncludes, setRecursive, setRootLocalFolder, setRootStarteamFolder, shouldProcess
 
Methods inherited from class org.apache.tools.ant.taskdefs.optional.starteam.StarTeamTask
getPassword, getProjectname, getServer, getServername, getServerport, getURL, getUserName, getUserName, getViewname, openView, setPassword, setProjectname, setServername, setServerport, setURL, setUserName, setViewname
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, handleErrorOutput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, 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)
Should all all local files not in StarTeam be deleted? 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

createSnapshotView

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.

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

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 - not thrown in this implementation
See Also:
execute()

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


Copyright 2000-2002 Apache Software Foundation. All Rights Reserved.