SVNKit Home

## 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.

Version:
  1.1.1
Author:
  TMate Software Ltd.
See Also:
  `SVNWCUtil`, Examples

Method Summary
`void` `addIgnorePattern(String pattern)` Adds a new particular ignore pattern to global ignore patterns.
`Map` `applyAutoProperties(File file, Map target)` Collects and puts into a `Map` all autoproperties specified for the file name pattern matched by the target file name.
`void` `deleteAutoProperty(String pattern)` Removes a particular autoproperty by specifying a file name pattern.
`void` `deleteIgnorePattern(String pattern)` Removes a particular global ignore pattern.
`Map` `getAutoProperties()` Returns autoproperties as a `Map` where each key is a file name pattern and the corresponding value is a string in the form of `"propName=propValue"`.
`String[]` `getIgnorePatterns()` Returns all the global ignore patterns.
`DateFormat` `getKeywordDateFormat()`
`ISVNMergerFactory` `getMergerFactory()` Returns a factory object which is responsible for creating merger drivers.
`String` `getPropertyValue(String propertyName)` Returns the value of a property from the [svnkit] section of the config file.
`boolean` `isAuthStorageEnabled()` Determines if the authentication storage is enabled.
`boolean` `isIgnored(File file)` Determines if a file is ignored according to the global ignore patterns.
`boolean` `isIgnored(String name)` Deprecated.
`boolean` `isUseAutoProperties()` Determines if the autoproperties option is enabled.
`boolean` `isUseCommitTimes()` Determines if the commit-times option is enabled.
`void` `setAuthStorageEnabled(boolean storeAuth)` Enables or disables the authentication storage.
`void` `setAutoProperties(Map autoProperties)` Sets autoproperties that will be automatically put on all files that will be added or imported.
`void` `setAutoProperty(String pattern, String properties)` Sets an autoproperty - binds a file name pattern with a string in the form of `"propName=propValue"`.
`void` `setIgnorePatterns(String[] patterns)` Sets global ignore patterns.
`void` `setMergerFactory(ISVNMergerFactory merger)` Sets a factory object which is responsible for creating merger drivers.
`void` `setPropertyValue(String propertyName, String propertyValue)` Sets the value of a property from the [svnkit] section of the config file.
`void` `setUseAutoProperties(boolean useAutoProperties)` Enables or disables the autoproperties option.
`void` `setUseCommitTimes(boolean useCommitTimes)` Enables or disables the commit-times option.

Methods inherited from interface org.tmatesoft.svn.core.io.ISVNTunnelProvider
`createTunnelConnector`

Method Detail

### isUseCommitTimes

    public 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
  See Also:
    `setUseCommitTimes(boolean)`

### 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
  See Also:
    `setUseAutoProperties(boolean)`

### 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
  See Also:
    `setAuthStorageEnabled(boolean)`

### 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()`

### isIgnored

    public boolean isIgnored(String name)

  Deprecated.

  Determines if a file is ignored according to 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.

  Parameters:
    `name` - a file name
  Returns:
    true if the file is ignored, otherwise false

### isIgnored

    public boolean isIgnored(File file)

  Determines if a file is ignored according to 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.

  Parameters:
    `file` - a file
  Returns:
    true if the file is ignored, otherwise false

### getIgnorePatterns

    public 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
  See Also:
    `setIgnorePatterns(String[])`

### setIgnorePatterns

    public void setIgnorePatterns(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 `.exe` files to be ignored include `"*.exe"` pattern into `patterns`.

  If `patterns` is 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(String pattern)

  Removes a particular global ignore pattern.

  Parameters:
    `pattern` - a patterna to be removed
  See Also:
    `addIgnorePattern(String)`

### addIgnorePattern

    public void addIgnorePattern(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 Map getAutoProperties()

  Returns autoproperties as a `Map` where each key is a file name pattern and the corresponding value is a string in the form of `"propName=propValue"`.

  Returns:
    a `Map` containing autoproperties
  See Also:
    `setAutoProperties(Map)`

### setAutoProperties

    public void setAutoProperties(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` - a `Map` which keys are file name patterns and their values are strings in the form of `"propName=propValue"`
  See Also:
    `getAutoProperties()`

### deleteAutoProperty

    public void deleteAutoProperty(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(String pattern,
                                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 for `pattern`
  See Also:
    `deleteAutoProperty(String)`

### applyAutoProperties

    public Map applyAutoProperties(File file,
                                   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

    public ISVNMergerFactory getMergerFactory()

  Returns a factory object which is responsible for creating merger drivers.

  Returns:
    a factory that produces merger drivers for merge operations
  See Also:
    `setMergerFactory(ISVNMergerFactory)`

### setMergerFactory

    public void setMergerFactory(ISVNMergerFactory merger)

  Sets a factory object which is responsible for creating merger drivers.

  Parameters:
    `merger` - a factory that produces merger drivers for merge operations
  See Also:
    `getMergerFactory()`

### getPropertyValue

    public String getPropertyValue(String propertyName)

  Returns the value of a property from the [svnkit] section of the config file. Currently not used.

  Parameters:
    `propertyName` - a SVNKit specific config property name
  Returns:
    the value of the property

### setPropertyValue

    public void setPropertyValue(String propertyName,
                                 String propertyValue)

  Sets the value of a property from the [svnkit] section of the config file. Currently not used.

  Parameters:
    `propertyName` - a SVNKit specific config property name
    `propertyValue` - a new value for the property; if null the property is removed

### getKeywordDateFormat

    public DateFormat getKeywordDateFormat()

SVNKit Home

Copyright © 2004-2008 TMate Software Ltd. All Rights Reserved.