org.tmatesoft.svn.core.wc
Interface ISVNOptions

All Superinterfaces:
ISVNTunnelProvider

public interface ISVNOptions
extends ISVNTunnelProvider

The ISVNOptions interface should be implemented to manage global run-time configuration options.

Like the Subversion client library SVNKit uses configuration options during runtime. ISVNOptions is intended for managing those options which are similar to ones you can meet in the config file located in the default Subversion configuration area - on Windows platforms it's usually located in the 'Documents and Settings\UserName\Subversion' (or simply '%APPDATA%\Subversion') directory, on Unix-like platforms - in '~/.subversion'. ISVNOptions is not intended for managing those options that can be met in the servers file (located in the same directory as config) - options for network layers are managed by interfaces and classes of the org.tmatesoft.svn.core.auth package.

Every SVN*Client's public constructor receives an ISVNOptions as a driver of the run-time configuration options. SVNClientManager also has got several newInstance() methods that receive an options driver. Thus it's simpe to implement a specific options driver to ISVNOptions and use it instead of a default one. However if you are not interested in customizing the run-time configuration area you can use a default driver which uses config info from the default SVN configuration area (see above).

Use SVNWCUtil to get a default options driver, like this:

 import org.tmatesoft.svn.core.wc.ISVNOptions;
 import org.tmatesoft.svn.core.wc.SVNClientManager;
 ...
     //here the only one boolean parameter - readonly - enables
     //or disables writing to the config file: if true (like in this snippet) -
     //SVNKit can only read options from the config file but not write
     ISVNOptions options = SVNWCUtil.createDefaultOptions(true);
     SVNClientManager clientManager = SVNClientManager.newInstance(options, "name", "password");
     ...

If you would like to have the default configuration area in a place different from the SVN default one, you should provide a preferred path to the config directory like this:

 import org.tmatesoft.svn.core.wc.ISVNOptions;
 import org.tmatesoft.svn.core.wc.SVNClientManager;
 ...
     File defaultConfigDir = new File("way/to/your/config/dir");
     ISVNOptions options = SVNWCUtil.createDefaultOptions(defaultConfigDir, true);
     SVNClientManager clientManager = SVNClientManager.newInstance(options, "name", "password");
     ...

In this case in the specified directory SVNKit will create necessary configuration files (in particular config and servers) which are absolutely identical to those default ones (without any user's edits) located in the SVN config area.

Read also this Subversion book chapter on runtime configuration area.

Since:
1.2
See Also:
SVNWCUtil, Examples

Method Summary
 java.util.Map applyAutoProperties(java.io.File file, java.util.Map target)
          Collects and puts into a Map all autoproperties specified for the file name pattern matched by the target file name.
 ISVNConflictHandler getConflictResolver()
           
 java.util.Map getFileExtensionsToMimeTypes()
          Returns a hash holding file extensions to MIME types mappings.
 java.lang.String[] getIgnorePatterns()
          Returns all the global ignore patterns.
 java.text.DateFormat getKeywordDateFormat()
          Returns the date format used to format datestamps.
 ISVNMergerFactory getMergerFactory()
          Returns a factory object which is responsible for creating merger drivers.
 java.lang.String getNativeCharset()
          Returns the native charset name.
 byte[] getNativeEOL()
          Returns the native EOL marker bytes.
 java.lang.String[] getPreservedConflictFileExtensions()
          Returns an array of path extensions which the user wants to preserve when conflict files are made.
 boolean isAllowAllForwardMergesFromSelf()
          Says to a merge driver whether to allow all forward merges or not.
 boolean isUseCommitTimes()
          Determines if the commit-times option is enabled.
 
Methods inherited from interface org.tmatesoft.svn.core.io.ISVNTunnelProvider
createTunnelConnector
 

Method Detail

isUseCommitTimes

boolean isUseCommitTimes()
Determines 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.

Returns:
true if commit-times are enabled, otherwise false

getIgnorePatterns

java.lang.String[] getIgnorePatterns()
Returns 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.

Returns:
an array of patterns (that usually contain wildcards) that specify file and directory names to be ignored until they are versioned

applyAutoProperties

java.util.Map applyAutoProperties(java.io.File file,
                                  java.util.Map target)
Collects and puts into a Map all autoproperties specified for the file name pattern matched by the target file name.

If fileName matches any known file name pattern then all properties set for that pattern will be collected and placed into target.

For one file name pattern there can be several autoproperties set, delimited by ";".

Parameters:
file - a target file
target - a Map that will receive autoproperties
Returns:
target itself

getMergerFactory

ISVNMergerFactory getMergerFactory()
Returns a factory object which is responsible for creating merger drivers.

Returns:
a factory that produces merger drivers for merge operations

getKeywordDateFormat

java.text.DateFormat getKeywordDateFormat()
Returns the date format used to format datestamps.

Returns:
date format

getPreservedConflictFileExtensions

java.lang.String[] getPreservedConflictFileExtensions()
Returns 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.

Returns:
array of preserved file extensions
Since:
1.2.0, new in Subversion 1.5.0

isAllowAllForwardMergesFromSelf

boolean isAllowAllForwardMergesFromSelf()
Says 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.

Returns:
true to allow all forward-merges; otherwise false
Since:
1.2.0

getNativeEOL

byte[] getNativeEOL()
Returns the native EOL marker bytes.

Returns:
native EOL bytes
Since:
1.2.0

getNativeCharset

java.lang.String getNativeCharset()
Returns the native charset name. See also SVNProperty.NATIVE.

Returns:
native charset name
Since:
1.2.0

getFileExtensionsToMimeTypes

java.util.Map getFileExtensionsToMimeTypes()
Returns a hash holding file extensions to MIME types mappings. Extensions must not include the leading dot in their names.

Returns:
map which keys are String file extensions, and values are String MIME types
Since:
1.2.0, New in Subversion 1.5.0

getConflictResolver

ISVNConflictHandler getConflictResolver()