Class DefaultSVNOptions
- java.lang.Object
-
- org.tmatesoft.svn.core.internal.wc.DefaultSVNOptions
-
- All Implemented Interfaces:
ISVNTunnelProvider,ISVNMergerFactory,ISVNOptions
public class DefaultSVNOptions extends java.lang.Object implements ISVNOptions, ISVNMergerFactory
- Version:
- 1.3
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringAUTH_GROUPprivate static java.lang.StringAUTOPROPS_GROUPprivate static java.lang.StringDEFAULT_IGNORESprivate static java.lang.StringDEFAULT_LOCALEprivate static java.lang.String[]DEFAULT_PASSWORD_STORE_TYPESprivate static java.lang.StringDEFAULT_TIMEZONEprivate static java.lang.StringDIFF_CMDprivate static java.lang.StringEDITOR_CMDprivate static java.lang.StringENABLE_AUTO_PROPSprivate static java.lang.StringGLOBAL_CHARSETprivate static java.lang.StringGLOBAL_IGNORESprivate static java.lang.StringHELPERS_GROUPprivate static java.lang.StringHTTP_SPOOL_DIRECTORYprivate static java.lang.StringINTERACTIVE_COFLICTSprivate static java.lang.StringKEYWORD_LOCALEprivate static java.lang.StringKEYWORD_TIMEZONEprivate static java.lang.StringLOG_ENCODINGprivate static java.lang.StringMERGE_TOOL_CMDprivate static java.lang.StringMIME_TYPES_FILEprivate static java.lang.StringMISCELLANY_GROUPprivate java.io.FilemyConfigDirectoryprivate SVNCompositeConfigFilemyConfigFileprivate java.util.MapmyConfigOptionsprivate ISVNConflictHandlermyConflictResolverprivate booleanmyIsReadonlyprivate java.text.SimpleDateFormatmyKeywordDateFormatprivate java.lang.StringmyKeywordLocaleprivate java.lang.StringmyKeywordTimezoneprivate ISVNMergerFactorymyMergerFactoryprivate static java.lang.StringNOprivate static java.lang.StringNO_UNLOCKprivate static java.lang.StringOLD_SVNKIT_GROUPprivate static java.lang.StringPASSWORD_STORESprivate static java.lang.StringPRESERVED_CONFLICT_FILE_EXTENSIONSprivate static java.lang.StringSTORE_AUTH_CREDSprivate static java.lang.StringSVNKIT_GROUPprivate static java.lang.StringUSE_COMMIT_TIMESprivate static java.lang.StringYES
-
Constructor Summary
Constructors Constructor Description DefaultSVNOptions()DefaultSVNOptions(java.io.File directory, boolean readOnly)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIgnorePattern(java.lang.String pattern)Adds a new particular ignore pattern to global ignore patterns.java.util.MapapplyAutoProperties(java.io.File file, java.util.Map target)Collects and puts into aMapall autoproperties specified for the file name pattern matched by the target file name.private static java.util.regex.PatterncompileNamePatter(java.lang.String wildcard)ISVNMergercreateMerger(byte[] conflictStart, byte[] conflictSeparator, byte[] conflictEnd)Creates a new merger driver.ISVNConnectorcreateTunnelConnector(SVNURL url)Returns a tunnel comand line matching the given subprotocol name.voiddeleteAutoProperty(java.lang.String pattern)Removes a particular autoproperty by specifying a file name pattern.voiddeleteIgnorePattern(java.lang.String pattern)Removes a particular global ignore pattern.java.util.MapgetAutoProperties()Returns autoproperties as aMapwhere each key is a file name pattern and the corresponding value is a string in the form of"propName=propValue".static booleangetBooleanValue(java.lang.String value, boolean defaultValue)private SVNCompositeConfigFilegetConfigFile()ISVNConflictHandlergetConflictResolver()private static java.io.FilegetDefaultConfigDir()private java.lang.StringgetDefaultSSHCommandLine()java.lang.StringgetDefaultSSHKeyFile()private java.lang.StringgetDefaultSSHOptionValue(java.lang.String optionName, java.lang.String systemProperty, java.lang.String fallbackSystemProperty)java.lang.StringgetDefaultSSHPassphrase()java.lang.StringgetDefaultSSHPassword()intgetDefaultSSHPortNumber()java.lang.StringgetDefaultSSHUserName()java.lang.StringgetDiffCommand()java.lang.StringgetEditor()java.util.MapgetFileExtensionsToMimeTypes()Returns a hash holding file extensions to MIME types mappings.java.lang.StringgetGlobalCharset()java.io.FilegetHttpSpoolDirectory()java.lang.String[]getIgnorePatterns()Returns all the global ignore patterns.java.text.DateFormatgetKeywordDateFormat()Returns the date format used to format datestamps.java.lang.StringgetLogEncoding()static longgetLongValue(java.lang.String value, long defaultValue)ISVNMergerFactorygetMergerFactory()Returns a factory object which is responsible for creating merger drivers.java.lang.StringgetMergeTool()java.lang.StringgetNativeCharset()Returns the native charset name.byte[]getNativeEOL()Returns the native EOL marker bytes.private static java.lang.StringgetOptionValue(java.lang.String commandLine, java.lang.String optionName)java.lang.String[]getPasswordStorageTypes()java.lang.String[]getPreservedConflictFileExtensions()Returns an array of path extensions which the user wants to preserve when conflict files are made.java.lang.StringgetPropertyValue(java.lang.String propertyName)Returns the value of a property from the [svnkit] section of the config file.booleanisAllowAllForwardMergesFromSelf()Says to a merge driver whether to allow all forward merges or not.booleanisAuthStorageEnabled()Determines if the authentication storage is enabled.static booleanisIgnored(ISVNOptions options, java.lang.String name)booleanisInteractiveConflictResolution()booleanisKeepLocks()booleanisUseAutoProperties()Determines if the autoproperties option is enabled.booleanisUseCommitTimes()Determines if the commit-times option is enabled.static booleanmatches(java.lang.String pattern, java.lang.String fileName)voidsetAuthStorageEnabled(boolean storeAuth)Enables or disables the authentication storage.voidsetAutoProperties(java.util.Map autoProperties)Sets autoproperties that will be automatically put on all files that will be added or imported.voidsetAutoProperty(java.lang.String pattern, java.lang.String properties)Sets an autoproperty - binds a file name pattern with a string in the form of"propName=propValue".voidsetConflictHandler(ISVNConflictHandler resolver)voidsetDiffCommand(java.lang.String diffCmd)voidsetGlobalCharset(java.lang.String charset)voidsetIgnorePatterns(java.lang.String[] patterns)Sets global ignore patterns.voidsetInMemoryConfigOptions(java.util.Map configOptions)voidsetInteractiveConflictResolution(boolean interactive)voidsetKeepLocks(boolean keep)voidsetMergerFactory(ISVNMergerFactory mergerFactory)Sets a factory object which is responsible for creating merger drivers.voidsetPropertyValue(java.lang.String propertyName, java.lang.String propertyValue)Sets the value of a property from the [svnkit] section of the config file.voidsetUseAutoProperties(boolean useAutoProperties)Enables or disables the autoproperties option.voidsetUseCommitTimes(boolean useCommitTimes)Enables or disables the commit-times option.private static java.util.LocaletoLocale(java.lang.String str)
-
-
-
Field Detail
-
MISCELLANY_GROUP
private static final java.lang.String MISCELLANY_GROUP
- See Also:
- Constant Field Values
-
AUTH_GROUP
private static final java.lang.String AUTH_GROUP
- See Also:
- Constant Field Values
-
AUTOPROPS_GROUP
private static final java.lang.String AUTOPROPS_GROUP
- See Also:
- Constant Field Values
-
SVNKIT_GROUP
private static final java.lang.String SVNKIT_GROUP
- See Also:
- Constant Field Values
-
OLD_SVNKIT_GROUP
private static final java.lang.String OLD_SVNKIT_GROUP
- See Also:
- Constant Field Values
-
HELPERS_GROUP
private static final java.lang.String HELPERS_GROUP
- See Also:
- Constant Field Values
-
HTTP_SPOOL_DIRECTORY
private static final java.lang.String HTTP_SPOOL_DIRECTORY
- See Also:
- Constant Field Values
-
USE_COMMIT_TIMES
private static final java.lang.String USE_COMMIT_TIMES
- See Also:
- Constant Field Values
-
GLOBAL_IGNORES
private static final java.lang.String GLOBAL_IGNORES
- See Also:
- Constant Field Values
-
ENABLE_AUTO_PROPS
private static final java.lang.String ENABLE_AUTO_PROPS
- See Also:
- Constant Field Values
-
STORE_AUTH_CREDS
private static final java.lang.String STORE_AUTH_CREDS
- See Also:
- Constant Field Values
-
KEYWORD_TIMEZONE
private static final java.lang.String KEYWORD_TIMEZONE
- See Also:
- Constant Field Values
-
KEYWORD_LOCALE
private static final java.lang.String KEYWORD_LOCALE
- See Also:
- Constant Field Values
-
EDITOR_CMD
private static final java.lang.String EDITOR_CMD
- See Also:
- Constant Field Values
-
DIFF_CMD
private static final java.lang.String DIFF_CMD
- See Also:
- Constant Field Values
-
MERGE_TOOL_CMD
private static final java.lang.String MERGE_TOOL_CMD
- See Also:
- Constant Field Values
-
NO_UNLOCK
private static final java.lang.String NO_UNLOCK
- See Also:
- Constant Field Values
-
LOG_ENCODING
private static final java.lang.String LOG_ENCODING
- See Also:
- Constant Field Values
-
PRESERVED_CONFLICT_FILE_EXTENSIONS
private static final java.lang.String PRESERVED_CONFLICT_FILE_EXTENSIONS
- See Also:
- Constant Field Values
-
INTERACTIVE_COFLICTS
private static final java.lang.String INTERACTIVE_COFLICTS
- See Also:
- Constant Field Values
-
MIME_TYPES_FILE
private static final java.lang.String MIME_TYPES_FILE
- See Also:
- Constant Field Values
-
GLOBAL_CHARSET
private static final java.lang.String GLOBAL_CHARSET
- See Also:
- Constant Field Values
-
PASSWORD_STORES
private static final java.lang.String PASSWORD_STORES
- See Also:
- Constant Field Values
-
DEFAULT_IGNORES
private static final java.lang.String DEFAULT_IGNORES
- See Also:
- Constant Field Values
-
YES
private static final java.lang.String YES
- See Also:
- Constant Field Values
-
NO
private static final java.lang.String NO
- See Also:
- Constant Field Values
-
DEFAULT_LOCALE
private static final java.lang.String DEFAULT_LOCALE
-
DEFAULT_TIMEZONE
private static final java.lang.String DEFAULT_TIMEZONE
-
DEFAULT_PASSWORD_STORE_TYPES
private static final java.lang.String[] DEFAULT_PASSWORD_STORE_TYPES
-
myIsReadonly
private boolean myIsReadonly
-
myConfigDirectory
private java.io.File myConfigDirectory
-
myConfigFile
private SVNCompositeConfigFile myConfigFile
-
myMergerFactory
private ISVNMergerFactory myMergerFactory
-
myConflictResolver
private ISVNConflictHandler myConflictResolver
-
myKeywordLocale
private java.lang.String myKeywordLocale
-
myKeywordTimezone
private java.lang.String myKeywordTimezone
-
myKeywordDateFormat
private java.text.SimpleDateFormat myKeywordDateFormat
-
myConfigOptions
private java.util.Map myConfigOptions
-
-
Method Detail
-
isUseCommitTimes
public boolean isUseCommitTimes()
Description copied from interface:ISVNOptionsDetermines if the commit-times option is enabled.The commit-times option makes checkout/update/switch/revert operations put last-committed timestamps on every file they touch.
This option corresponds to the 'use-commit-times' option that can be found in the SVN's config file under the [miscellany] section.
- Specified by:
isUseCommitTimesin interfaceISVNOptions- Returns:
- true if commit-times are enabled, otherwise false
-
setInMemoryConfigOptions
public void setInMemoryConfigOptions(java.util.Map configOptions)
-
setUseCommitTimes
public void setUseCommitTimes(boolean useCommitTimes)
Enables or disables the commit-times option.The commit-times option makes checkout/update/switch/revert operations put last-committed timestamps on every file they touch.
This option corresponds to the 'use-commit-times' option that can be found in the SVN's config file under the [miscellany] section.
- Parameters:
useCommitTimes- true to enable commit-times, false to disable- See Also:
isUseCommitTimes()
-
isUseAutoProperties
public boolean isUseAutoProperties()
Determines if the autoproperties option is enabled.Autoproperties are the properties that are automatically set on files when they are added or imported.
This option corresponds to the 'enable-auto-props' option that can be found in the SVN's config file under the [miscellany] section.
- Returns:
- true if autoproperties are enabled, otherwise false
-
setUseAutoProperties
public void setUseAutoProperties(boolean useAutoProperties)
Enables or disables the autoproperties option.Autoproperties are the properties that are automatically set on files when they are added or imported.
This option corresponds to the 'enable-auto-props' option that can be found in the SVN's config file under the [miscellany] section.
- Parameters:
useAutoProperties- true to enable autoproperties, false to disable- See Also:
isUseAutoProperties()
-
isAuthStorageEnabled
public boolean isAuthStorageEnabled()
Determines if the authentication storage is enabled.The auth storage is used for disk-caching of all authentication information: usernames, passwords, server certificates, and any other types of cacheable credentials.
This option corresponds to the 'store-auth-creds' option that can be found in the SVN's config file under the [auth] section.
- Returns:
- true if auth storage is enabled, otherwise false
-
isKeepLocks
public boolean isKeepLocks()
-
setAuthStorageEnabled
public void setAuthStorageEnabled(boolean storeAuth)
Enables or disables the authentication storage.The auth storage is used for disk-caching of all authentication information: usernames, passwords, server certificates, and any other types of cacheable credentials.
This option corresponds to the 'store-auth-creds' option that can be found in the SVN's config file under the [auth] section.
- Parameters:
storeAuth- true to enable the auth storage, false to disable- See Also:
isAuthStorageEnabled()
-
setKeepLocks
public void setKeepLocks(boolean keep)
-
isIgnored
public static boolean isIgnored(ISVNOptions options, java.lang.String name)
-
getIgnorePatterns
public java.lang.String[] getIgnorePatterns()
Description copied from interface:ISVNOptionsReturns all the global ignore patterns.The global ignore patterns describe the names of files and directories that SVNKit should ignore during status, add and import operations. Similar to the 'global-ignores' option that can be found in the SVN's config file under the [miscellany] section.
- Specified by:
getIgnorePatternsin interfaceISVNOptions- Returns:
- an array of patterns (that usually contain wildcards) that specify file and directory names to be ignored until they are versioned
-
setIgnorePatterns
public void setIgnorePatterns(java.lang.String[] patterns)
Sets global ignore patterns.The global ignore patterns describe the names of files and directories that SVNKit should ignore during status, add and import operations. Similar to the 'global-ignores' option that can be found in the SVN's config file under the [miscellany] section.
For example, to set all
.exefiles to be ignored include"*.exe"pattern intopatterns.If
patternsis null or empty then all the patterns will be removed.- Parameters:
patterns- an array of patterns (that usually contain wildcards) that specify file and directory names to be ignored until they are versioned- See Also:
getIgnorePatterns()
-
deleteIgnorePattern
public void deleteIgnorePattern(java.lang.String pattern)
Removes a particular global ignore pattern.- Parameters:
pattern- a patterna to be removed- See Also:
addIgnorePattern(String)
-
addIgnorePattern
public void addIgnorePattern(java.lang.String pattern)
Adds a new particular ignore pattern to global ignore patterns.- Parameters:
pattern- an ignore pattern to be added- See Also:
deleteIgnorePattern(String)
-
getAutoProperties
public java.util.Map getAutoProperties()
Returns autoproperties as aMapwhere each key is a file name pattern and the corresponding value is a string in the form of"propName=propValue".- Returns:
- a
Mapcontaining autoproperties
-
setAutoProperties
public void setAutoProperties(java.util.Map autoProperties)
Sets autoproperties that will be automatically put on all files that will be added or imported.There can be several properties specified for one file pattern - they should be delimited by ";".
- Parameters:
autoProperties- aMapwhich keys are file name patterns and their values are strings in the form of"propName=propValue"- See Also:
getAutoProperties()
-
getEditor
public java.lang.String getEditor()
-
getMergeTool
public java.lang.String getMergeTool()
-
deleteAutoProperty
public void deleteAutoProperty(java.lang.String pattern)
Removes a particular autoproperty by specifying a file name pattern.- Parameters:
pattern- a file name pattern- See Also:
setAutoProperty(String, String)
-
setAutoProperty
public void setAutoProperty(java.lang.String pattern, java.lang.String properties)Sets an autoproperty - binds a file name pattern with a string in the form of"propName=propValue".- Parameters:
pattern- a file name pattern (usually containing wildcards)properties- a property forpattern
-
isInteractiveConflictResolution
public boolean isInteractiveConflictResolution()
-
setInteractiveConflictResolution
public void setInteractiveConflictResolution(boolean interactive)
-
applyAutoProperties
public java.util.Map applyAutoProperties(java.io.File file, java.util.Map target)Description copied from interface:ISVNOptionsCollects and puts into aMapall autoproperties specified for the file name pattern matched by the target file name.If
fileNamematches any known file name pattern then all properties set for that pattern will be collected and placed intotarget.For one file name pattern there can be several autoproperties set, delimited by ";".
- Specified by:
applyAutoPropertiesin interfaceISVNOptions- Parameters:
file- a target filetarget- aMapthat will receive autoproperties- Returns:
targetitself
-
getMergerFactory
public ISVNMergerFactory getMergerFactory()
Description copied from interface:ISVNOptionsReturns a factory object which is responsible for creating merger drivers.- Specified by:
getMergerFactoryin interfaceISVNOptions- Returns:
- a factory that produces merger drivers for merge operations
-
setMergerFactory
public void setMergerFactory(ISVNMergerFactory mergerFactory)
Sets a factory object which is responsible for creating merger drivers.- Parameters:
mergerFactory- a factory that produces merger drivers for merge operations- See Also:
getMergerFactory()
-
getPropertyValue
public java.lang.String getPropertyValue(java.lang.String propertyName)
Returns the value of a property from the [svnkit] section of the config file.- Parameters:
propertyName- a SVNKit specific config property name- Returns:
- the value of the property
-
getHttpSpoolDirectory
public java.io.File getHttpSpoolDirectory()
-
setPropertyValue
public void setPropertyValue(java.lang.String propertyName, java.lang.String propertyValue)Sets the value of a property from the [svnkit] section of the config file.- Parameters:
propertyName- a SVNKit specific config property namepropertyValue- a new value for the property; if null the property is removed
-
setConflictHandler
public void setConflictHandler(ISVNConflictHandler resolver)
-
getConflictResolver
public ISVNConflictHandler getConflictResolver()
- Specified by:
getConflictResolverin interfaceISVNOptions
-
matches
public static boolean matches(java.lang.String pattern, java.lang.String fileName)
-
createMerger
public ISVNMerger createMerger(byte[] conflictStart, byte[] conflictSeparator, byte[] conflictEnd)
Description copied from interface:ISVNMergerFactoryCreates a new merger driver.If a merger driver can not cleanly apply delta to a file (in case of a conflict state) then for each conflicting contents fragment the driver puts local data between the specified
conflictStartandconflictSeparatorbytes, and the newcomer data between the specifiedconflictSeparatorandconflictEndones. And all these bytes are then written to the file in the place of a conflict.- Specified by:
createMergerin interfaceISVNMergerFactory- Parameters:
conflictStart- bytes that come in the very beginning of a conflictconflictSeparator- bytes that are used to separate two conflicting fragments - local data and the newcomer oneconflictEnd- bytes that come in the very end of a conflict- Returns:
- a merger driver
-
createTunnelConnector
public ISVNConnector createTunnelConnector(SVNURL url)
Description copied from interface:ISVNTunnelProviderReturns a tunnel comand line matching the given subprotocol name.- Specified by:
createTunnelConnectorin interfaceISVNTunnelProvider- Returns:
- a tunnel command line
-
getKeywordDateFormat
public java.text.DateFormat getKeywordDateFormat()
Description copied from interface:ISVNOptionsReturns the date format used to format datestamps.- Specified by:
getKeywordDateFormatin interfaceISVNOptions- Returns:
- date format
-
getPreservedConflictFileExtensions
public java.lang.String[] getPreservedConflictFileExtensions()
Description copied from interface:ISVNOptionsReturns an array of path extensions which the user wants to preserve when conflict files are made. If the extension of a conflicted path does not match any of the returned by this method or if this method returns null, the extension (if any) of the conflicted file will be cut off.- Specified by:
getPreservedConflictFileExtensionsin interfaceISVNOptions- Returns:
- array of preserved file extensions
-
isAllowAllForwardMergesFromSelf
public boolean isAllowAllForwardMergesFromSelf()
Description copied from interface:ISVNOptionsSays to a merge driver whether to allow all forward merges or not. If this returns true, we allow all forward-merges not already found in recorded mergeinfo, and thus we destroy the ability to, say, merge the whole of a branch to the trunk while automatically ignoring the revisions common to both. If this returns false, we allow only forward-merges not found in either recorded mergeinfo or implicit mergeinfo (natural history), then the previous scenario works great, but we can't reverse-merge a previous change made to our line of history and then remake it (because the reverse-merge will leave no mergeinfo trace, and the remake-it attempt will still find the original change in natural mergeinfo.- Specified by:
isAllowAllForwardMergesFromSelfin interfaceISVNOptions- Returns:
- true to allow all forward-merges; otherwise false
-
getLogEncoding
public java.lang.String getLogEncoding()
-
getGlobalCharset
public java.lang.String getGlobalCharset()
-
setGlobalCharset
public void setGlobalCharset(java.lang.String charset)
-
getNativeCharset
public java.lang.String getNativeCharset()
Description copied from interface:ISVNOptionsReturns the native charset name. See alsoSVNProperty.NATIVE.- Specified by:
getNativeCharsetin interfaceISVNOptions- Returns:
- native charset name
-
getNativeEOL
public byte[] getNativeEOL()
Description copied from interface:ISVNOptionsReturns the native EOL marker bytes.- Specified by:
getNativeEOLin interfaceISVNOptions- Returns:
- native EOL bytes
-
getFileExtensionsToMimeTypes
public java.util.Map getFileExtensionsToMimeTypes()
Description copied from interface:ISVNOptionsReturns a hash holding file extensions to MIME types mappings. Extensions must not include the leading dot in their names.- Specified by:
getFileExtensionsToMimeTypesin interfaceISVNOptions- Returns:
- map which keys are
Stringfile extensions, and values areStringMIME types
-
getDiffCommand
public java.lang.String getDiffCommand()
-
setDiffCommand
public void setDiffCommand(java.lang.String diffCmd)
-
getPasswordStorageTypes
public java.lang.String[] getPasswordStorageTypes()
-
getDefaultSSHCommandLine
private java.lang.String getDefaultSSHCommandLine()
-
getDefaultSSHOptionValue
private java.lang.String getDefaultSSHOptionValue(java.lang.String optionName, java.lang.String systemProperty, java.lang.String fallbackSystemProperty)
-
getDefaultSSHPortNumber
public int getDefaultSSHPortNumber()
-
getDefaultSSHUserName
public java.lang.String getDefaultSSHUserName()
-
getDefaultSSHPassword
public java.lang.String getDefaultSSHPassword()
-
getDefaultSSHKeyFile
public java.lang.String getDefaultSSHKeyFile()
-
getDefaultSSHPassphrase
public java.lang.String getDefaultSSHPassphrase()
-
getConfigFile
private SVNCompositeConfigFile getConfigFile()
-
getOptionValue
private static java.lang.String getOptionValue(java.lang.String commandLine, java.lang.String optionName)
-
compileNamePatter
private static java.util.regex.Pattern compileNamePatter(java.lang.String wildcard)
-
toLocale
private static java.util.Locale toLocale(java.lang.String str)
-
getDefaultConfigDir
private static java.io.File getDefaultConfigDir()
-
getBooleanValue
public static boolean getBooleanValue(java.lang.String value, boolean defaultValue)
-
getLongValue
public static long getLongValue(java.lang.String value, long defaultValue)
-
-