org.tmatesoft.svn.core.wc

Class SVNCopyClient

public class SVNCopyClient extends SVNBasicClient

The SVNCopyClient provides methods to perform any kinds of copying and moving that SVN supports - operating on both Working Copies (WC) and URLs.

Copy operations allow a user to copy versioned files and directories with all their previous history in several ways.

Supported copy operations are:

Besides just copying SVNCopyClient also is able to move a versioned item - that is first making a copy of the source item and then scheduling the source item for deletion when operating on a Working Copy, or right committing the deletion of the source item when operating immediately on the repository.

Supported move operations are:

Overloaded doCopy() methods of SVNCopyClient are similar to 'svn copy' and 'svn move' commands of the SVN command line client.

Version: 1.1.1

Author: TMate Software Ltd.

See Also: Examples

Constructor Summary
SVNCopyClient(ISVNAuthenticationManager authManager, ISVNOptions options)
Constructs and initializes an SVNCopyClient object with the specified run-time configuration and authentication drivers.
SVNCopyClient(ISVNRepositoryPool repositoryPool, ISVNOptions options)
Method Summary
SVNCommitInfodoCopy(SVNURL srcURL, SVNRevision srcRevision, SVNURL dstURL, boolean isMove, String commitMessage)
Copies/moves a source URL to a destination one immediately committing changes to a repository.
SVNCommitInfodoCopy(SVNURL srcURL, SVNRevision srcRevision, SVNURL dstURL, boolean isMove, boolean failWhenDstExists, String commitMessage)
Copies/moves a source URL to a destination one immediately committing changes to a repository.
SVNCommitInfodoCopy(File srcPath, SVNRevision srcRevision, SVNURL dstURL, String commitMessage)
Copies a source Working Copy path (or its repository location URL) to a destination URL immediately committing changes to a repository.
SVNCommitInfodoCopy(File srcPath, SVNRevision srcRevision, SVNURL dstURL, boolean failWhenDstExists, String commitMessage)
Copies a source Working Copy path (or its repository location URL) to a destination URL immediately committing changes to a repository.
longdoCopy(SVNURL srcURL, SVNRevision srcRevision, File dstPath)
Copies a source URL to a destination Working Copy path.
voiddoCopy(File srcPath, SVNRevision srcRevision, File dstPath, boolean force, boolean isMove)
Copies/moves a source Working Copy path to a destination Working Copy path.
ISVNCommitHandlergetCommitHandler()
Returns the specified commit handler (if set) being in use or a default one (DefaultSVNCommitHandler) if no special implementations of ISVNCommitHandler were previousely provided.
ISVNCommitParametersgetCommitParameters()
Returns commit parameters.
voidsetCommitHandler(ISVNCommitHandler handler)
Sets an implementation of ISVNCommitHandler to the commit handler that will be used during commit operations to handle commit log messages.
voidsetCommitParameters(ISVNCommitParameters parameters)
Sets commit parameters to use.

Constructor Detail

SVNCopyClient

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

If options is null, then this SVNCopyClient 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 SVNCopyClient 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

SVNCopyClient

public SVNCopyClient(ISVNRepositoryPool repositoryPool, ISVNOptions options)

Method Detail

doCopy

public SVNCommitInfo doCopy(SVNURL srcURL, SVNRevision srcRevision, SVNURL dstURL, boolean isMove, String commitMessage)
Copies/moves a source URL to a destination one immediately committing changes to a repository. Equivalent to doCopy(srcURL, srcRevision, dstURL, isMove, false, commitMessage).

Parameters: srcURL a source repository location URL srcRevision a revision of srcURL dstURL a target URL where srcURL is to be copied/moved isMove true to move the source to the target (only URL-to-URL), false to copy commitMessage a commit log message

Returns: information on the committed revision

Throws: SVNException

See Also: SVNCopyClient

doCopy

public SVNCommitInfo doCopy(SVNURL srcURL, SVNRevision srcRevision, SVNURL dstURL, boolean isMove, boolean failWhenDstExists, String commitMessage)
Copies/moves a source URL to a destination one immediately committing changes to a repository.

If dstURL and srcURL are the same, failWhenDstExists is false and srcURL is a directory then this directory will be copied into itself.

If dstURL is a directory, dstURL and srcURL are not the same, failWhenDstExists is false, dstURL has not the last path element entry of srcURL then that entry will be copied into dstURL.

Parameters: srcURL a source repository location URL srcRevision a revision of srcURL dstURL a target URL where srcURL is to be copied/moved isMove true to move the source to the target (only URL-to-URL), false to copy failWhenDstExists true to force a failure if the destination exists commitMessage a commit log message

Returns: information on the committed revision

Throws: SVNException if one of the following is true:

doCopy

public SVNCommitInfo doCopy(File srcPath, SVNRevision srcRevision, SVNURL dstURL, String commitMessage)
Copies a source Working Copy path (or its repository location URL) to a destination URL immediately committing changes to a repository.

Equivalent to doCopy(srcPath, srcRevision, dstURL, false, commitMessage).

Parameters: srcPath a source Working Copy path srcRevision a revision of srcPath dstURL a target URL where srcPath is to be copied commitMessage a commit log message

Returns: information on the committed revision

Throws: SVNException if one of the following is true:

See Also: SVNCopyClient

doCopy

public SVNCommitInfo doCopy(File srcPath, SVNRevision srcRevision, SVNURL dstURL, boolean failWhenDstExists, String commitMessage)
Copies a source Working Copy path (or its repository location URL) to a destination URL immediately committing changes to a repository.

If srcRevision is not WORKING then the repository location URL of srcPath is copied to dstURL. Otherwise srcPath itself.

failWhenDstExists behaves like in SVNCopyClient.

Parameters: srcPath a source Working Copy path srcRevision a revision of srcPath dstURL a target URL where srcPath is to be copied failWhenDstExists true to force a failure if the destination exists commitMessage a commit log message

Returns: information on the committed revision

Throws: SVNException if one of the following is true:

doCopy

public long doCopy(SVNURL srcURL, SVNRevision srcRevision, File dstPath)
Copies a source URL to a destination Working Copy path.

dstPath will be automatically scheduled for addition with history.

Parameters: srcURL a source URL srcRevision a revision of srcURL dstPath a destination WC path

Returns: the revision number of a source

Throws: SVNException if one of the following is true:

doCopy

public void doCopy(File srcPath, SVNRevision srcRevision, File dstPath, boolean force, boolean isMove)
Copies/moves a source Working Copy path to a destination Working Copy path.

If srcRevision is not WORKING and isMove = false, then the repository location URL of srcPath is copied to dstPath. Otherwise srcPath itself.

dstPath will be automatically scheduled for addition with history.

Parameters: srcPath a source WC path srcRevision a revision of srcPath dstPath a destination WC path force true to force the operation to run isMove true to move the source to the target (only WC-to-WC), false to copy

Throws: SVNException if one of the following is true:

getCommitHandler

public ISVNCommitHandler getCommitHandler()
Returns the specified commit handler (if set) being in use or a default one (DefaultSVNCommitHandler) if no special implementations of ISVNCommitHandler were previousely provided.

Returns: the commit handler being in use or a default one

See Also: setCommitHandler DefaultSVNCommitHandler

getCommitParameters

public ISVNCommitParameters getCommitParameters()
Returns commit parameters.

If no user parameters were previously specified, once creates and returns default ones.

Returns: commit parameters

See Also: setCommitParameters

setCommitHandler

public void setCommitHandler(ISVNCommitHandler handler)
Sets an implementation of ISVNCommitHandler to the commit handler that will be used during commit operations to handle commit log messages. The handler will receive a clien's log message and items (represented as SVNCommitItem objects) that will be committed. Depending on implementor's aims the initial log message can be modified (or something else) and returned back.

If using SVNCopyClient without specifying any commit handler then a default one will be used - DefaultSVNCommitHandler.

Parameters: handler an implementor's handler that will be used to handle commit log messages

See Also: getCommitHandler SVNCommitItem

setCommitParameters

public void setCommitParameters(ISVNCommitParameters parameters)
Sets commit parameters to use.

When no parameters are set default ones are used.

Parameters: parameters commit parameters

See Also: getCommitParameters

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