org.tmatesoft.svn.core.wc

Class SVNUpdateClient

public class SVNUpdateClient extends SVNBasicClient

This class provides methods which allow to check out, update, switch and relocate a Working Copy as well as export an unversioned directory or file from a repository.

Here's a list of the SVNUpdateClient's methods matched against corresponing commands of the SVN command line client:

SVNKit Subversion
doCheckout()'svn checkout'
doUpdate()'svn update'
doSwitch()'svn switch'
doRelocate()'svn switch --relocate oldURL newURL'
doExport()'svn export'

Version: 1.1.1

Author: TMate Software Ltd.

See Also: Examples

Constructor Summary
SVNUpdateClient(ISVNAuthenticationManager authManager, ISVNOptions options)
Constructs and initializes an SVNUpdateClient object with the specified run-time configuration and authentication drivers.
SVNUpdateClient(ISVNRepositoryPool repositoryPool, ISVNOptions options)
Method Summary
voiddoCanonicalizeURLs(File dst, boolean omitDefaultPort, boolean recursive)
Canonicalizes all urls in the specified Working Copy.
longdoCheckout(SVNURL url, File dstPath, SVNRevision pegRevision, SVNRevision revision, boolean recursive)
Checks out a Working Copy from a repository.
longdoExport(SVNURL url, File dstPath, SVNRevision pegRevision, SVNRevision revision, String eolStyle, boolean force, boolean recursive)
Exports a clean directory or single file from a repository.
longdoExport(File srcPath, File dstPath, SVNRevision pegRevision, SVNRevision revision, String eolStyle, boolean force, boolean recursive)
Exports a clean directory or single file from eihter a source Working Copy or a repository.
voiddoRelocate(File dst, SVNURL oldURL, SVNURL newURL, boolean recursive)
Substitutes the beginning part of a Working Copy's URL with a new one.
longdoSwitch(File file, SVNURL url, SVNRevision revision, boolean recursive)
Updates the Working Copy item to mirror a new URL.
longdoSwitch(File file, SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive)
Updates the Working Copy item to mirror a new URL.
longdoUpdate(File file, SVNRevision revision, boolean recursive)
Brings the Working Copy item up-to-date with repository changes at the specified revision.
protected SVNRevisiongetExternalRevision(File file, SVNURL newURL)

Constructor Detail

SVNUpdateClient

public SVNUpdateClient(ISVNAuthenticationManager authManager, ISVNOptions options)
Constructs and initializes an SVNUpdateClient object with the specified run-time configuration and authentication drivers.

If options is null, then this SVNUpdateClient will be using a default run-time configuration driver which takes client-side settings from the default SVN's run-time configuration area but is not able to change those settings (read more on ISVNOptions and SVNWCUtil).

If authManager is null, then this SVNUpdateClient will be using a default authentication and network layers driver (see createDefaultAuthenticationManager) which uses server-side settings and auth storage from the default SVN's run-time configuration area (or system properties if that area is not found).

Parameters: authManager an authentication and network layers driver options a run-time configuration options driver

SVNUpdateClient

public SVNUpdateClient(ISVNRepositoryPool repositoryPool, ISVNOptions options)

Method Detail

doCanonicalizeURLs

public void doCanonicalizeURLs(File dst, boolean omitDefaultPort, boolean recursive)
Canonicalizes all urls in the specified Working Copy.

Parameters: dst a WC path omitDefaultPort if true then removes all port numbers from urls which equal to default ones, otherwise does not recursive recurses an operation

Throws: SVNException

doCheckout

public long doCheckout(SVNURL url, File dstPath, SVNRevision pegRevision, SVNRevision revision, boolean recursive)
Checks out a Working Copy from a repository.

If the destination path (dstPath) is null then the last component of url is used for the local directory name.

As a revision SVNRevision's pre-defined constant fields can be used. For example, to check out a Working Copy at the latest revision of the repository use HEAD.

Parameters: url a repository location from where a Working Copy will be checked out dstPath the local path where the Working Copy will be placed pegRevision the revision at which url will be firstly seen in the repository to make sure it's the one that is needed revision the desired revision of the Working Copy to be checked out recursive if true and url is a directory then the entire tree will be checked out, otherwise if false - only items located immediately in the directory itself

Returns: the revision number of the Working Copy

Throws: SVNException url refers to a file, not a directory; dstPath already exists but it is a file, not a directory; dstPath already exists and is a versioned directory but has a different URL (repository location against which the directory is controlled)

doExport

public long doExport(SVNURL url, File dstPath, SVNRevision pegRevision, SVNRevision revision, String eolStyle, boolean force, boolean recursive)
Exports a clean directory or single file from a repository.

If eolStyle is not null then it should denote a specific End-Of-Line marker for the files to be exported. Significant values for eolStyle are:

Parameters: url a repository location from where the unversioned directory/file will be exported dstPath the local path where the repository items will be exported to pegRevision the revision at which url will be firstly seen in the repository to make sure it's the one that is needed revision the desired revision of the directory/file to be exported eolStyle a string that denotes a specific End-Of-Line charecter; force true to fore the operation even if there are local files with the same names as those in the repository (local ones will be replaced) recursive if true and url is a directory then the entire tree will be exported, otherwise if false - only items located immediately in the directory itself

Returns: the revision number of the exported directory/file

Throws: SVNException

doExport

public long doExport(File srcPath, File dstPath, SVNRevision pegRevision, SVNRevision revision, String eolStyle, boolean force, boolean recursive)
Exports a clean directory or single file from eihter a source Working Copy or a repository.

How this method works:

If eolStyle is not null then it should denote a specific End-Of-Line marker for the files to be exported. Significant values for eolStyle are:

Parameters: srcPath a repository location from where the unversioned directory/file will be exported dstPath the local path where the repository items will be exported to pegRevision the revision at which url will be firstly seen in the repository to make sure it's the one that is needed revision the desired revision of the directory/file to be exported eolStyle a string that denotes a specific End-Of-Line charecter; force true to fore the operation even if there are local files with the same names as those in the repository (local ones will be replaced) recursive if true and url is a directory then the entire tree will be exported, otherwise if false - only items located immediately in the directory itself

Returns: the revision number of the exported directory/file

Throws: SVNException

doRelocate

public void doRelocate(File dst, SVNURL oldURL, SVNURL newURL, boolean recursive)
Substitutes the beginning part of a Working Copy's URL with a new one.

When a repository root location or a URL schema is changed the old URL of the Working Copy which starts with oldURL should be substituted for a new URL beginning - newURL.

Parameters: dst a Working Copy item's path oldURL the old beginning part of the repository's URL that should be overwritten newURL a new beginning part for the repository location that will overwrite oldURL recursive if true and dst is a directory then the entire tree will be relocated, otherwise if false - only dst itself

Throws: SVNException

doSwitch

public long doSwitch(File file, SVNURL url, SVNRevision revision, boolean recursive)
Updates the Working Copy item to mirror a new URL.

As a revision SVNRevision's pre-defined constant fields can be used. For example, to update the Working Copy to the latest revision of the repository use HEAD.

Calling this method is equivalent to doSwitch(file, url, SVNRevision.UNDEFINED, revision, recursive).

Parameters: file the Working copy item to be switched url the repository location as a target against which the item will be switched revision the desired revision of the repository target recursive if true and file is a directory then the entire tree will be updated, otherwise if false - only items located immediately in the directory itself

Returns: the revision number to which file was updated to

Throws: SVNException

doSwitch

public long doSwitch(File file, SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive)
Updates the Working Copy item to mirror a new URL.

As a revision SVNRevision's pre-defined constant fields can be used. For example, to update the Working Copy to the latest revision of the repository use HEAD.

Parameters: file the Working copy item to be switched url the repository location as a target against which the item will be switched pegRevision a revision in which file is first looked up in the repository revision the desired revision of the repository target recursive if true and file is a directory then the entire tree will be updated, otherwise if false - only items located immediately in the directory itself

Returns: the revision number to which file was updated to

Throws: SVNException

doUpdate

public long doUpdate(File file, SVNRevision revision, boolean recursive)
Brings the Working Copy item up-to-date with repository changes at the specified revision.

As a revision SVNRevision's pre-defined constant fields can be used. For example, to update the Working Copy to the latest revision of the repository use HEAD.

Parameters: file the Working copy item to be updated revision the desired revision against which the item will be updated recursive if true and file is a directory then the entire tree will be updated, otherwise if false - only items located immediately in the directory itself

Returns: the revision number to which file was updated to

Throws: SVNException

getExternalRevision

protected SVNRevision getExternalRevision(File file, SVNURL newURL)
Copyright © 2004-2007 TMate Software Ltd. All Rights Reserved.