net.sourceforge.cruisecontrol.sourcecontrols
Class Vss

java.lang.Object
  extended bynet.sourceforge.cruisecontrol.sourcecontrols.Vss
All Implemented Interfaces:
java.io.Serializable, SourceControl

public class Vss
extends java.lang.Object
implements SourceControl

This class handles all VSS-related aspects of determining the modifications since the last good build.

Author:
alden almagro, Eli Tucker, Jason Yip, Arun Aggarwal
See Also:
Serialized Form

Constructor Summary
Vss()
           
 
Method Summary
protected  java.lang.String[] getCommandLine(java.util.Date lastBuild, java.util.Date now)
           
 java.util.List getModifications(java.util.Date lastBuild, java.util.Date now)
          Calls "ss history [dir] -R -Vd[now]~[lastBuild] -Y[login] -I-N -O[tempFileName]" Results written to a file since VSS will start wrapping lines if read directly from the stream.
 java.util.Map getProperties()
          Any properties that have been set in this sourcecontrol.
protected  java.text.SimpleDateFormat getVssDateTimeFormat()
           
protected  Modification handleEntry(java.util.List entry)
          Parse individual VSS history entry
 java.util.Date parseDate(java.lang.String nameAndDateLine)
          Parse date/time from VSS file history The nameAndDateLine will look like
User: Etucker Date: 6/26/01 Time: 11:53a
Sometimes also this
User: Aaggarwa Date: 6/29/:1 Time: 3:40p
Note the ":" instead of a "0"
 java.lang.String parseUser(java.lang.String userLine)
          Parse username from VSS file history
 void setDateFormat(java.lang.String format)
          Sets the date format to use for querying VSS and processing reports.
 void setLogin(java.lang.String usernameCommaPassword)
          Login for vss
 void setProperty(java.lang.String propertyName)
          Choose a property to be set if the project has modifications if we have a change that only requires repackaging, i.e. jsp, we don't need to recompile everything, just rejar.
 void setPropertyOnDelete(java.lang.String propertyName)
          Choose a property to be set if the project has deletions
 void setServerPath(java.lang.String dirWithSrcsafeIni)
          Set the path to the directory containing the srcsafe.ini file.
 void setSsDir(java.lang.String ssdir)
          Set the path to the ss executable
 void setTimeFormat(java.lang.String format)
          Sets the time format to use for querying VSS and processing reports.
 void setVsspath(java.lang.String vsspath)
          Set the project to get history from
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Vss

public Vss()
Method Detail

setVsspath

public void setVsspath(java.lang.String vsspath)
Set the project to get history from

Parameters:
vsspath -

setSsDir

public void setSsDir(java.lang.String ssdir)
Set the path to the ss executable

Parameters:
ssdir -

setServerPath

public void setServerPath(java.lang.String dirWithSrcsafeIni)
Set the path to the directory containing the srcsafe.ini file.

Parameters:
dirWithSrcsafeIni -

setLogin

public void setLogin(java.lang.String usernameCommaPassword)
Login for vss

Parameters:
usernameCommaPassword -

setProperty

public void setProperty(java.lang.String propertyName)
Choose a property to be set if the project has modifications if we have a change that only requires repackaging, i.e. jsp, we don't need to recompile everything, just rejar.

Parameters:
propertyName -

setPropertyOnDelete

public void setPropertyOnDelete(java.lang.String propertyName)
Choose a property to be set if the project has deletions

Parameters:
propertyName -

setDateFormat

public void setDateFormat(java.lang.String format)
Sets the date format to use for querying VSS and processing reports. The default date format is MM/dd/yy . If your computer is set to a different region, you may wish to use a format such as dd/MM/yy .

See Also:
SimpleDateFormat

setTimeFormat

public void setTimeFormat(java.lang.String format)
Sets the time format to use for querying VSS and processing reports. The default time format is hh:mma . If your computer is set to a different region, you may wish to use a format such as HH:mm .

See Also:
SimpleDateFormat

getProperties

public java.util.Map getProperties()
Description copied from interface: SourceControl
Any properties that have been set in this sourcecontrol. Will be passed onto the Builder, which may then pass the properties to the underlying build implementation. For example, the Ant builder will define these properties so that the underlying Ant script can use them.

Specified by:
getProperties in interface SourceControl

validate

public void validate()
              throws CruiseControlException
Specified by:
validate in interface SourceControl
Throws:
CruiseControlException

getModifications

public java.util.List getModifications(java.util.Date lastBuild,
                                       java.util.Date now)
Calls "ss history [dir] -R -Vd[now]~[lastBuild] -Y[login] -I-N -O[tempFileName]" Results written to a file since VSS will start wrapping lines if read directly from the stream.

Specified by:
getModifications in interface SourceControl
Parameters:
lastBuild -
now -
Returns:
List of modifications

getCommandLine

protected java.lang.String[] getCommandLine(java.util.Date lastBuild,
                                            java.util.Date now)
                                     throws java.io.IOException
Throws:
java.io.IOException

handleEntry

protected Modification handleEntry(java.util.List entry)
Parse individual VSS history entry

Parameters:
entry -

parseDate

public java.util.Date parseDate(java.lang.String nameAndDateLine)
Parse date/time from VSS file history The nameAndDateLine will look like
User: Etucker Date: 6/26/01 Time: 11:53a
Sometimes also this
User: Aaggarwa Date: 6/29/:1 Time: 3:40p
Note the ":" instead of a "0"

Parameters:
nameAndDateLine -
Returns:
Date in form "'Date: 'MM/dd/yy 'Time: 'hh:mma", or a different form based on dateFormat
See Also:
setDateFormat(java.lang.String)

parseUser

public java.lang.String parseUser(java.lang.String userLine)
Parse username from VSS file history

Parameters:
userLine -
Returns:
the user name who made the modification

getVssDateTimeFormat

protected java.text.SimpleDateFormat getVssDateTimeFormat()