com.starteam
Class CheckoutOptions

java.lang.Object
  extended by com.starteam.CheckoutOptions

public final class CheckoutOptions
extends java.lang.Object

Maintains the checkout options used by CheckoutManager.

See Also:
CheckoutManager

Nested Class Summary
static interface CheckoutOptions.ContentFilter
          Allows an application to hook into the checkout process at a low level.
static class CheckoutOptions.WebCacheCheckoutOptions
          Maintains the checkout options used by WebCacheCheckoutManager.
 
Constructor Summary
CheckoutOptions(CheckoutOptions options)
          Construct a CheckoutOptions object from the specified copy.
CheckoutOptions(StarTeamClientOptions options)
          Construct a CheckoutOptions object with default options from a StarTeamClientOptions object.
CheckoutOptions(View view)
          Construct a CheckoutOptions object with default options from the View.
 
Method Summary
 boolean getBreakLock()
          Returns true if another users lock will be broken during checkout
 DateTime getCheckoutByDate()
          Get DateTime value for "checkout by date" option.
 Label getCheckoutByLabel()
          Get the Label for the "checkout by Label" option.
 PromotionState getCheckoutByPromotionState()
          Get the PromotionState ID for "checkout by PromotionState" option.
 int getCheckoutByViewVersion()
          Get the View Version for "checkout by View Version" option.
 CheckoutOptions.ContentFilter getContentFilter()
          Get the hook to be inserted after performing keyword expansion, eol conversion, etc.
 File.EOLFormat getEOLFormat()
          Gets the end-of-line format to be used by working files.
 Encoding getFileEncoding()
          Returns the "File Encoding" option value.
 boolean getForceCheckout()
          Returns the "Force Checkout" option value.
 boolean getKeywordExpansionEnabled()
          Determin whether keyword expansion in text files is enabled.
 ViewMember.LockType getLockType()
          Return the type of lock to be used when checking out.
 boolean getMarkUnlockedFilesReadOnly()
          Returns the "Mark Unlocked Files ReadOnly" option value.
 boolean getRestoreFileOnError()
          Determine whether to restore previous working file if an error occurs during a checkout.
 boolean getTimeStampNow()
          Return whether the current time is used as the last modified time.
 boolean getUpdateStatus()
          Determine whether to update status information after a successful checkout.
 boolean isByDate()
          Determines whether "checkout by date" option is used.
 boolean isByLabel()
          Determines whether "checkout by Label" option is used.
 boolean isByPromotionState()
          Determines whether "checkout by PromotionState" option is used.
 boolean isByViewVersion()
          Determines whether "checkout by view version" option is used.
 boolean isFileSkipped()
          Returns whether to skip checking out files or the file associated with this CheckoutOptions object.
 boolean isTip()
          Determine which file revision is checked out.
 void setBreakLock(boolean breakLock)
          set to True to break another users lock during checkout
 void setCheckoutByDate(DateTime d)
          Set to "checkout by date" on the given DateTime value.
 void setCheckoutByLabel(Label label)
          Set to "checkout by Label" on the given Label.
 void setCheckoutByPromotionState(PromotionState state)
          Set to "checkout by PromotionState" on the given PromotionState ID.
 void setCheckoutByViewVersion(int viewVersion)
          Set to "checkout by View Version" on the given View Version.
 void setCheckoutTip()
          Determines which file revision is checked out.
 void setContentFilter(CheckoutOptions.ContentFilter filter)
          Set the hook inserted after performing keyword expansion, eol conversion, etc.
 void setEOLFormat(File.EOLFormat format)
          Sets the EOL format to be used by working files.
 void setFileEncoding(Encoding sEncoding)
          Sets the "File Encoding" option value.
 void setFileSkipped(boolean bFileSkipped)
          Sets whether to skip checking out files or the file associated with this CheckoutOptions object.
 void setForceCheckout(boolean bForceCheckout)
          Sets the "Force Checkout" option value.
 void setKeywordExpansionEnabled(boolean bEnabled)
          Set to enable keyword expansion in text files.
 void setLockType(ViewMember.LockType lockType)
          Set the type of lock to be used when checking out.
 void setMarkUnlockedFilesReadOnly(boolean bMarkUnlockedFilesReadOnly)
          Sets the "Mark Unlocked Files ReadOnly" option value.
 void setRestoreFileOnError(boolean bEnabled)
          Set to restore previous working file if an error occurs during a checkout.
 void setTimeStampNow(boolean bTimeStampNow)
          Set to use the current time as the last modified time.
 void setUpdateStatus(boolean bEnabled)
          Set to whether to update status information after a successful checkout.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckoutOptions

public CheckoutOptions(View view)
Construct a CheckoutOptions object with default options from the View. The following options are assigned values DefaultEOLFormat

Parameters:
view - a View object where the values of the options are picked up.
See Also:
CheckoutOptions.getEOLFormat(), KeywordExpansionEnabled, CheckoutOptions.getKeywordExpansionEnabled(), MarkUnlockedFilesReadOnly, CheckoutOptions.getMarkUnlockedFilesReadOnly(), FileEncoding, CheckoutOptions.getFileEncoding(), CheckoutOptions.setFileEncoding(Encoding), CheckoutManager.getOptions(), View

CheckoutOptions

public CheckoutOptions(StarTeamClientOptions options)
Construct a CheckoutOptions object with default options from a StarTeamClientOptions object. The following options are assigned values LockType

Parameters:
options - a StarTeamClientOptions where the values of the options are picked up.
See Also:
CheckoutOptions.getLockType(), TimeStampNow, CheckoutOptions.getTimeStampNow(), DefaultEOLFormat, CheckoutOptions.getEOLFormat(), MarkUnlockedFilesReadOnly, CheckoutOptions.getMarkUnlockedFilesReadOnly(), FileEncoding, CheckoutOptions.getFileEncoding(), CheckoutOptions.setFileEncoding(Encoding), CheckoutManager.getOptions(), StarTeamClientOptions.loadDefault()

CheckoutOptions

public CheckoutOptions(CheckoutOptions options)
Construct a CheckoutOptions object from the specified copy.

Parameters:
options - a CheckoutOptions copied from another instance.
See Also:
CheckoutManager.getOptions()
Method Detail

setLockType

public void setLockType(ViewMember.LockType lockType)
Set the type of lock to be used when checking out. Default is Item.LockType.UNCHANGED.

Parameters:
lockType - the type of lock to be used when checking out, one of the values supported by Item.LockType.
See Also:
ViewMember.LockType

getLockType

public ViewMember.LockType getLockType()
Return the type of lock to be used when checking out. Default is Item.LockType.UNCHANGED.

Returns:
Return the type of lock to be used when checking out, one of the values supported by Item.LockType.
See Also:
ViewMember.LockType

getBreakLock

public boolean getBreakLock()
Returns true if another users lock will be broken during checkout

Returns:
true if another users lock will be broken during checkout

setBreakLock

public void setBreakLock(boolean breakLock)
set to True to break another users lock during checkout

Parameters:
breakLock - set to True to break another users lock during checkout

setTimeStampNow

public void setTimeStampNow(boolean bTimeStampNow)
Set to use the current time as the last modified time. True to set last modified time of working files to current time; false to set last modified time of working files to match revision time in repository. Default is true.

Parameters:
bTimeStampNow - if true will use current time.

getTimeStampNow

public boolean getTimeStampNow()
Return whether the current time is used as the last modified time.

Returns:
Return true if current time is used as the last modified time; false, otherwise.

getEOLFormat

public File.EOLFormat getEOLFormat()
Gets the end-of-line format to be used by working files.

Default value is EOLFormat.PLATFORM, which uses the native platform end-of-line format.

null indicates that EOL conversion is disabled, which results in working files having the platform EOL.

Ignored for binary files, and for files with a fixed EOL format.

Returns:
EOLFormat

setEOLFormat

public void setEOLFormat(File.EOLFormat format)
Sets the EOL format to be used by working files.

Default value is EOLFormat.PLATFORM, which uses the native platform end-of-line format.

null indicates that EOL conversion is disabled, which results in working files having the platform EOL.

Ignored for binary files, and for files with a fixed EOL format.

Parameters:
format - The desired end-of-line format, or null to disable end-of-line conversion for files that don't have a fixed format.

setUpdateStatus

public void setUpdateStatus(boolean bEnabled)
Set to whether to update status information after a successful checkout. Default is true.

Parameters:
bEnabled - True to update status information after a successful checkout; false, otherwise.

getMarkUnlockedFilesReadOnly

public boolean getMarkUnlockedFilesReadOnly()
Returns the "Mark Unlocked Files ReadOnly" option value.

Returns:
option value. Default if not defined: false

setMarkUnlockedFilesReadOnly

public void setMarkUnlockedFilesReadOnly(boolean bMarkUnlockedFilesReadOnly)
Sets the "Mark Unlocked Files ReadOnly" option value.

Parameters:
bMarkUnlockedFilesReadOnly - the "Mark Unlocked Files ReadOnly" option value.
See Also:
CheckoutListener.startFile(com.starteam.events.CheckoutEvent)

getForceCheckout

public boolean getForceCheckout()
Returns the "Force Checkout" option value. When "Force Checkout" is true, the operation will check out files that might not otherwise be checked out, for example files that have a status of "modified", "merge" or "unknown".

Returns:
the "Force Checkout" option value, whose default value is false.

setForceCheckout

public void setForceCheckout(boolean bForceCheckout)
Sets the "Force Checkout" option value. When "Force Checkout" is true, the operation will check out files that might not otherwise be checked out, for example files that have a status of "modified", "merge" or "unknown".

Parameters:
bForceCheckout - the "Force Checkout" option value.

getFileEncoding

public Encoding getFileEncoding()
Returns the "File Encoding" option value.

Returns:
the "File Encoding" option value. Default if not defined: the value of the system property "file.encoding"

setFileEncoding

public void setFileEncoding(Encoding sEncoding)
Sets the "File Encoding" option value.

Parameters:
sEncoding - the "File Encoding" option value.
See Also:
CheckoutListener.startFile(com.starteam.events.CheckoutEvent)

isFileSkipped

public boolean isFileSkipped()
Returns whether to skip checking out files or the file associated with this CheckoutOptions object.

Returns:
whether to skip checking out files or the file associated with this CheckoutOptions object.

setFileSkipped

public void setFileSkipped(boolean bFileSkipped)
Sets whether to skip checking out files or the file associated with this CheckoutOptions object. Calling setFileSkipped(true) in the CheckoutListener.onStartFile() event handler will cause CheckoutManager to leave the working file for this file unchanged. Calling setFileSkipped() outside of the onStartFile() handler has no effect.

Parameters:
bFileSkipped - whether to skip checking out files or the file associated with this CheckoutOptions object.
See Also:
CheckoutListener.startFile(com.starteam.events.CheckoutEvent)

getUpdateStatus

public boolean getUpdateStatus()
Determine whether to update status information after a successful checkout.

Returns:
Return true if status information is to be updated after a successful checkout.

setKeywordExpansionEnabled

public void setKeywordExpansionEnabled(boolean bEnabled)
Set to enable keyword expansion in text files. Default uses setting from the Project properties. Even if this property is set to true, keyword expansion for a specific file is determined by Project keyword property settings and the file extension.

Parameters:
bEnabled - True to use keyword expansion in text files; false, otherwise.

getKeywordExpansionEnabled

public boolean getKeywordExpansionEnabled()
Determin whether keyword expansion in text files is enabled.

Returns:
Return true if keyword expansion in text files is enabled; false, otherwise.

setCheckoutTip

public void setCheckoutTip()
Determines which file revision is checked out. Default is the tip; you can also select a historical revision by label, date or promotion state. Files that don't match (e.g., don't have the given label attached) are skipped.

See Also:
CheckoutOptions.isTip(), CheckoutOptions.setCheckoutByDate(com.starteam.util.DateTime), CheckoutOptions.setCheckoutByLabel(com.starteam.Label), CheckoutOptions.setCheckoutByPromotionState(com.starteam.PromotionState)

isTip

public boolean isTip()
Determine which file revision is checked out. Default is the tip; you can also select a historical revision by label, date or promotion state. Files that don't match (e.g., don't have the given label attached) are skipped.

Returns:
Return true if the tip is used; false, otherwise.

setCheckoutByDate

public void setCheckoutByDate(DateTime d)
Set to "checkout by date" on the given DateTime value. Default is the tip; you can also select a historical revision by label, date or promotion state. Files that don't match (e.g., didn't have it on that date) are skipped. Use null DateTime to indicate tip revision.

Parameters:
d - the DateTime value to be used for the "checkout by date" option.
See Also:
CheckoutOptions.isByDate(), CheckoutOptions.setCheckoutByLabel(com.starteam.Label), CheckoutOptions.setCheckoutByPromotionState(com.starteam.PromotionState)

isByDate

public boolean isByDate()
Determines whether "checkout by date" option is used.

Returns:
Return true if "checkout by date" option is used; false, otherwise.
See Also:
CheckoutOptions.setCheckoutByDate(com.starteam.util.DateTime), CheckoutOptions.setCheckoutByLabel(com.starteam.Label), CheckoutOptions.setCheckoutByPromotionState(com.starteam.PromotionState)

getCheckoutByDate

public DateTime getCheckoutByDate()
Get DateTime value for "checkout by date" option. Default is the tip; you can also select a historical revision by label, date or promotion state. Files that don't match (e.g., don't have the given label attached) are skipped.

Returns:
Return the DateTime value to be used for the "checkout by date" option.
See Also:
CheckoutOptions.isByDate(), CheckoutOptions.setCheckoutByDate(com.starteam.util.DateTime), CheckoutOptions.setCheckoutByLabel(com.starteam.Label), CheckoutOptions.setCheckoutByPromotionState(com.starteam.PromotionState), CheckoutOptions.setCheckoutByViewVersion(int)

setCheckoutByLabel

public void setCheckoutByLabel(Label label)
Set to "checkout by Label" on the given Label. Default is the tip; you can also select a historical revision by date, label or promotion state. Files that don't match (e.g., don't have the given Label attached) are skipped. Use null Label to indicate tip revision.

Parameters:
label - the Label to be used for the "checkout by Label" option.
See Also:
CheckoutOptions.isByLabel(), CheckoutOptions.setCheckoutByDate(com.starteam.util.DateTime), CheckoutOptions.setCheckoutByPromotionState(com.starteam.PromotionState), CheckoutOptions.setCheckoutByViewVersion(int)

isByLabel

public boolean isByLabel()
Determines whether "checkout by Label" option is used.

Returns:
Return true if "checkout by Label" option is used; false, otherwise.
See Also:
CheckoutOptions.setCheckoutByDate(com.starteam.util.DateTime), CheckoutOptions.setCheckoutByLabel(com.starteam.Label), CheckoutOptions.setCheckoutByPromotionState(com.starteam.PromotionState), CheckoutOptions.setCheckoutByViewVersion(int)

getCheckoutByLabel

public Label getCheckoutByLabel()
Get the Label for the "checkout by Label" option. Default is the tip; you can also select a historical revision by date, label or promotion state. Files that don't match (e.g., don't have the given Label attached) are skipped.

Returns:
Return the Label to be used for the "checkout by Label" option.
See Also:
CheckoutOptions.isByLabel(), CheckoutOptions.setCheckoutByDate(com.starteam.util.DateTime), CheckoutOptions.setCheckoutByLabel(com.starteam.Label), CheckoutOptions.setCheckoutByPromotionState(com.starteam.PromotionState)

setCheckoutByPromotionState

public void setCheckoutByPromotionState(PromotionState state)
Set to "checkout by PromotionState" on the given PromotionState ID. Default is the tip; you can also select a historical revision by date, label or promotion state. Files that don't match (e.g., don't have the given PromotionState attached) are skipped. Use null PromotionState to indicate tip revision.

Parameters:
state - the PromotionState to be used for the "checkout by PromotionState" option.
See Also:
CheckoutOptions.isByPromotionState(), CheckoutOptions.setCheckoutByDate(com.starteam.util.DateTime), CheckoutOptions.setCheckoutByLabel(com.starteam.Label), CheckoutOptions.setCheckoutByViewVersion(int)

isByPromotionState

public boolean isByPromotionState()
Determines whether "checkout by PromotionState" option is used.

Returns:
Return true if "checkout by PromotionState" option is used; false, otherwise.
See Also:
CheckoutOptions.setCheckoutByDate(com.starteam.util.DateTime), CheckoutOptions.setCheckoutByLabel(com.starteam.Label), CheckoutOptions.setCheckoutByPromotionState(com.starteam.PromotionState), CheckoutOptions.setCheckoutByViewVersion(int)

getCheckoutByPromotionState

public PromotionState getCheckoutByPromotionState()
Get the PromotionState ID for "checkout by PromotionState" option. Default is the tip; you can also select a historical revision by date, label or promotion state. Files that don't match (e.g., don't have the given PromotionState attached) are skipped.

Returns:
Return the PromotionState ID value to be used for the "checkout by PromotionState" option.
See Also:
CheckoutOptions.isByPromotionState(), CheckoutOptions.setCheckoutByDate(com.starteam.util.DateTime), CheckoutOptions.setCheckoutByLabel(com.starteam.Label), CheckoutOptions.setCheckoutByPromotionState(com.starteam.PromotionState)

isByViewVersion

public boolean isByViewVersion()
Determines whether "checkout by view version" option is used.

Returns:
Return true if "checkout by view version" option is used; false, otherwise.
See Also:
CheckoutOptions.setCheckoutByViewVersion(int), CheckoutOptions.getCheckoutByViewVersion()

setCheckoutByViewVersion

public void setCheckoutByViewVersion(int viewVersion)
Set to "checkout by View Version" on the given View Version. Default is the tip; you can also select a historical revision by date, label, promotion state or view version. Files that don't match (e.g., don't have the given view version attached) are skipped.

Parameters:
viewVersion - the view version to be used for the "checkout by View Version" option.
See Also:
CheckoutOptions.isByViewVersion(), CheckoutOptions.getCheckoutByViewVersion()

getCheckoutByViewVersion

public int getCheckoutByViewVersion()
Get the View Version for "checkout by View Version" option. Default is the tip; you can also select a historical revision by date, label, promotion state or view version. Files that don't match (e.g., don't belong to the given view version) are skipped.

Returns:
Return the view version value to be used for the "checkout by view version" option.
See Also:
CheckoutOptions.isByViewVersion(), \

setRestoreFileOnError

public void setRestoreFileOnError(boolean bEnabled)
Set to restore previous working file if an error occurs during a checkout. If true, then file content is streamed to a temporary file, which requires more disk space. Default is true.

Parameters:
bEnabled - True if the previous working file should be restored if an error occurs during a checkout; otherwise, false.

getRestoreFileOnError

public boolean getRestoreFileOnError()
Determine whether to restore previous working file if an error occurs during a checkout.

Returns:
Return True if the previous working file should be restored if an error occurs during a checkout; otherwise, false.

setContentFilter

public void setContentFilter(CheckoutOptions.ContentFilter filter)
Set the hook inserted after performing keyword expansion, eol conversion, etc.

Parameters:
filter - The ContentFilter object to be used after performing keyword expansion, eol conversion, etc.

getContentFilter

public CheckoutOptions.ContentFilter getContentFilter()
Get the hook to be inserted after performing keyword expansion, eol conversion, etc.

Returns:
Return the ContentFilter object to be used after performing keyword expansion, eol conversion, etc.


StarTeam SDK 14.0, Build 21
Copyright © 2003-2012 Borland Software Corporation. All rights reserved.