Class VssParameterContext


  • public class VssParameterContext
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String autoResponse  
      private java.lang.String comment  
      private java.lang.String date  
      private java.text.DateFormat dateFormat
      Date format for History
      private java.lang.String fromDate
      From date
      private java.lang.String fromLabel  
      private boolean getLocalCopy
      Get local copy for checkout defaults to true
      private java.lang.String label  
      private java.lang.String localPath  
      private int numDays
      Number of days offset for History
      private java.lang.String outputFileName  
      private boolean quiet  
      private boolean recursive  
      private java.lang.String ssDir  
      private java.lang.String style  
      private java.lang.String timestamp  
      private java.lang.String toDate
      To date
      private java.lang.String toLabel  
      private java.lang.String user  
      private java.lang.String version  
      private java.lang.String vssLogin  
      private java.lang.String vssPath  
      private boolean writable  
      private java.lang.String writableFiles
      Behaviour for writable files
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.String calcDate​(java.lang.String startDate, int daysToAdd)
      Calculate the start date for version comparison.
      java.lang.String getAutoresponse()
      Gets the auto response string.
      java.lang.String getComment()
      Gets the comment string.
      java.lang.String getFileTimeStamp()
      Gets the value set for the FileTimeStamp.
      java.lang.String getGetLocalCopy()
      Builds and returns the -G- flag if required.
      static VssParameterContext getInstance​(java.lang.Object obj)  
      java.lang.String getLabel()
      Gets the label string.
      java.lang.String getLocalpath()
      Gets the localpath string.
      java.lang.String getLogin()
      Gets the login string.
      java.lang.String getOutput()
      Gets the output file string.
      java.lang.String getQuiet()
      Gets the quiet string.
      java.lang.String getRecursive()
      Gets the recursive string.
      private java.lang.String getShortLabel()
      Return at most the 30 first chars of the label, logging a warning message about the truncation
      java.lang.String getSSCommand()
      Gets the sscommand string.
      java.lang.String getStyle()
      Gets the style string.
      java.lang.String getUser()
      Gets the user string.
      java.lang.String getVersion()
      Gets the version string.
      java.lang.String getVersionDate()
      Gets the Version date string.
      java.lang.String getVersionDateLabel()
      Gets the version string.
      java.lang.String getVersionLabel()  
      java.lang.String getVssPath()  
      java.lang.String getWritable()
      Gets the writable string.
      java.lang.String getWritableFiles()
      Gets the value to determine the behaviour when encountering writable files.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • vssPath

        private java.lang.String vssPath
      • autoResponse

        private java.lang.String autoResponse
      • ssDir

        private java.lang.String ssDir
      • vssLogin

        private java.lang.String vssLogin
      • comment

        private java.lang.String comment
      • user

        private java.lang.String user
      • fromLabel

        private java.lang.String fromLabel
      • toLabel

        private java.lang.String toLabel
      • quiet

        private boolean quiet
      • recursive

        private boolean recursive
      • writable

        private boolean writable
      • label

        private java.lang.String label
      • style

        private java.lang.String style
      • version

        private java.lang.String version
      • date

        private java.lang.String date
      • localPath

        private java.lang.String localPath
      • timestamp

        private java.lang.String timestamp
      • writableFiles

        private java.lang.String writableFiles
        Behaviour for writable files
      • fromDate

        private java.lang.String fromDate
        From date
      • toDate

        private java.lang.String toDate
        To date
      • numDays

        private int numDays
        Number of days offset for History
      • getLocalCopy

        private boolean getLocalCopy
        Get local copy for checkout defaults to true
      • dateFormat

        private java.text.DateFormat dateFormat
        Date format for History
      • outputFileName

        private java.lang.String outputFileName
    • Method Detail

      • getGetLocalCopy

        public java.lang.String getGetLocalCopy()
        Builds and returns the -G- flag if required.
        Returns:
        An empty string if get local copy is true.
      • calcDate

        private java.lang.String calcDate​(java.lang.String startDate,
                                          int daysToAdd)
                                   throws java.text.ParseException
        Calculate the start date for version comparison.

        Calculate the date numDay days earlier than startdate.

        Parameters:
        startDate - The start date.
        daysToAdd - The number of days to add.
        Returns:
        The calculated date.
        Throws:
        java.text.ParseException
      • getFileTimeStamp

        public java.lang.String getFileTimeStamp()
        Gets the value set for the FileTimeStamp. if it equals "current" then we return -GTC if it equals "modified" then we return -GTM if it equals "updated" then we return -GTU otherwise we return -GTC
        Returns:
        The default file time flag, if not set.
      • getLocalpath

        public java.lang.String getLocalpath()
                                      throws ScmException
        Gets the localpath string. "-GLc:\source"

        The localpath is created if it didn't exist.

        Returns:
        An empty string if localpath is not set.
        Throws:
        ScmException
      • getLabel

        public java.lang.String getLabel()
        Gets the label string. "-Lbuild1" Max label length is 32 chars
        Returns:
        An empty string if label is not set.
      • getVersionDateLabel

        public java.lang.String getVersionDateLabel()
        Gets the version string. Returns the first specified of version "-V1.0", date "-Vd01.01.01", label "-Vlbuild1".
        Returns:
        An empty string if a version, date and label are not set.
      • getVersion

        public java.lang.String getVersion()
        Gets the version string.
        Returns:
        An empty string if a version is not set.
      • getShortLabel

        private java.lang.String getShortLabel()
        Return at most the 30 first chars of the label, logging a warning message about the truncation
        Returns:
        at most the 30 first chars of the label
      • getStyle

        public java.lang.String getStyle()
        Gets the style string. "-Lbuild1"
        Returns:
        An empty string if label is not set.
      • getRecursive

        public java.lang.String getRecursive()
        Gets the recursive string. "-R"
        Returns:
        An empty string if recursive is not set or is false.
      • getWritable

        public java.lang.String getWritable()
        Gets the writable string. "-W"
        Returns:
        An empty string if writable is not set or is false.
      • getQuiet

        public java.lang.String getQuiet()
        Gets the quiet string. -O-
        Returns:
        An empty string if quiet is not set or is false.
      • getVersionLabel

        public java.lang.String getVersionLabel()
      • getUser

        public java.lang.String getUser()
        Gets the user string. "-Uusername"
        Returns:
        An empty string if user is not set.
      • getComment

        public java.lang.String getComment()
        Gets the comment string. "-Ccomment text"
        Returns:
        A comment of "-" if comment is not set.
      • getLogin

        public java.lang.String getLogin()
        Gets the login string. This can be user and password, "-Yuser,password" or just user "-Yuser".
        Returns:
        An empty string if login is not set.
      • getAutoresponse

        public java.lang.String getAutoresponse()
        Gets the auto response string. This can be Y "-I-Y" or N "-I-N".
        Returns:
        The default value "-I-" if autoresponse is not set.
      • getSSCommand

        public java.lang.String getSSCommand()
        Gets the sscommand string. "ss" or "c:\path\to\ss"
        Returns:
        The path to ss.exe or just ss if sscommand is not set.
      • getVssPath

        public java.lang.String getVssPath()
      • getVersionDate

        public java.lang.String getVersionDate()
                                        throws ScmException
        Gets the Version date string.
        Returns:
        An empty string if neither Todate or from date are set.
        Throws:
        ScmException
      • getOutput

        public java.lang.String getOutput()
        Gets the output file string. "-Ooutput.file"
        Returns:
        An empty string if user is not set.
      • getWritableFiles

        public java.lang.String getWritableFiles()
        Gets the value to determine the behaviour when encountering writable files.
        Returns:
        An empty String, if not set.