org.tmatesoft.svn.core.wc
public class SVNWCClient extends SVNBasicClient
Here's a list of the SVNWCClient's methods matched against corresponing commands of the SVN command line client:
| SVNKit | Subversion |
| doAdd() | 'svn add' |
| doDelete() | 'svn delete' |
| doCleanup() | 'svn cleanup' |
| doInfo() | 'svn info' |
| doLock() | 'svn lock' |
| doUnlock() | 'svn unlock' |
| doSetProperty() |
'svn propset PROPNAME PROPVAL PATH' 'svn propdel PROPNAME PATH' 'svn propedit PROPNAME PATH' |
| doSetRevisionProperty() |
'svn propset PROPNAME --revprop -r REV PROPVAL [URL]' 'svn propdel PROPNAME --revprop -r REV [URL]' 'svn propedit PROPNAME --revprop -r REV [URL]' |
| doGetProperty() |
'svn propget PROPNAME PATH' 'svn proplist PATH' |
| doGetRevisionProperty() |
'svn propget PROPNAME --revprop -r REV [URL]' 'svn proplist --revprop -r REV [URL]' |
| doResolve() | 'svn resolved' |
| doRevert() | 'svn revert' |
Version: 1.1.1
See Also: Examples
| Field Summary | |
|---|---|
| static ISVNAddParameters | DEFAULT_ADD_PARAMETERS |
| Constructor Summary | |
|---|---|
| SVNWCClient(ISVNAuthenticationManager authManager, ISVNOptions options)
Constructs and initializes an SVNWCClient object
with the specified run-time configuration and authentication
drivers.
| |
| SVNWCClient(ISVNRepositoryPool repositoryPool, ISVNOptions options) | |
| Method Summary | |
|---|---|
| void | doAdd(File path, boolean force, boolean mkdir, boolean climbUnversionedParents, boolean recursive)
Schedules an unversioned item for addition to a repository thus
putting it under version control.
|
| void | doAdd(File path, boolean force, boolean mkdir, boolean climbUnversionedParents, boolean recursive, boolean includeIgnored)
Schedules an unversioned item for addition to a repository thus
putting it under version control.
|
| void | doCleanup(File path)
Recursively cleans up the working copy, removing locks and resuming
unfinished operations.
|
| void | doDelete(File path, boolean force, boolean dryRun)
Schedules a Working Copy item for deletion.
|
| void | doDelete(File path, boolean force, boolean deleteFiles, boolean dryRun)
Schedules a Working Copy item for deletion. |
| void | doGetFileContents(File path, SVNRevision pegRevision, SVNRevision revision, boolean expandKeywords, OutputStream dst)
Gets contents of a file.
|
| void | doGetFileContents(SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean expandKeywords, OutputStream dst)
Gets contents of a file of a particular revision from a repository.
|
| SVNPropertyData | doGetProperty(File path, String propName, SVNRevision pegRevision, SVNRevision revision, boolean recursive)
Gets an item's versioned property. |
| SVNPropertyData | doGetProperty(SVNURL url, String propName, SVNRevision pegRevision, SVNRevision revision, boolean recursive)
Gets an item's versioned property from a repository.
|
| void | doGetProperty(File path, String propName, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNPropertyHandler handler)
Gets an item's versioned property and passes it to a provided property
handler. |
| void | doGetProperty(SVNURL url, String propName, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNPropertyHandler handler)
Gets an item's versioned property from a repository and passes it to
a provided property handler. |
| void | doGetRevisionProperty(File path, String propName, SVNRevision revision, ISVNPropertyHandler handler)
Gets an unversioned revision property from a repository (getting
a repository URL from a Working Copy) and passes it to a provided
property handler.
|
| void | doGetRevisionProperty(SVNURL url, String propName, SVNRevision revision, ISVNPropertyHandler handler)
Gets an unversioned revision property from a repository and passes
it to a provided property handler.
|
| String | doGetWorkingCopyID(File path, String trailURL)
Returns the current Working Copy min- and max- revisions as well as
changes and switch status within a single string.
|
| String | doGetWorkingCopyID(File path, String trailURL, boolean committed) |
| void | doInfo(File path, SVNRevision revision, boolean recursive, ISVNInfoHandler handler)
Collects information about Working Copy item(s) and passes it to an
info handler.
|
| void | doInfo(File path, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNInfoHandler handler)
Collects information about Working Copy item(s) and passes it to an
info handler.
|
| void | doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNInfoHandler handler)
Collects information about item(s) in a repository and passes it to
an info handler.
|
| SVNInfo | doInfo(File path, SVNRevision revision)
Collects and returns information on a single Working Copy item.
|
| SVNInfo | doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision)
Collects and returns information on a single item in a repository.
|
| void | doLock(File[] paths, boolean stealLock, String lockMessage)
Locks file items in a Working Copy as well as in a repository so that
no other user can commit changes to them.
|
| void | doLock(SVNURL[] urls, boolean stealLock, String lockMessage)
Locks file items in a repository so that no other user can commit
changes to them.
|
| void | doResolve(File path, boolean recursive)
Resolves a 'conflicted' state on a Working Copy item.
|
| void | doRevert(File path, boolean recursive)
Reverts all local changes made to a Working Copy item(s) thus
bringing it to a 'pristine' state.
|
| void | doRevert(File[] paths, boolean recursive)
Reverts all local changes made to a Working Copy item(s) thus
bringing it to a 'pristine' state.
|
| void | doSetProperty(File path, String propName, String propValue, boolean force, boolean recursive, ISVNPropertyHandler handler)
Sets, edits or deletes a property on a file or directory item(s).
|
| void | doSetRevisionProperty(File path, SVNRevision revision, String propName, String propValue, boolean force, ISVNPropertyHandler handler)
Sets, edits or deletes an unversioned revision property.
|
| void | doSetRevisionProperty(SVNURL url, SVNRevision revision, String propName, String propValue, boolean force, ISVNPropertyHandler handler)
Sets, edits or deletes an unversioned revision property.
|
| void | doUnlock(File[] paths, boolean breakLock)
Unlocks file items in a Working Copy as well as in a repository.
|
| void | doUnlock(SVNURL[] urls, boolean breakLock)
Unlocks file items in a repository.
|
| protected ISVNAddParameters | getAddParameters() |
| void | setAddParameters(ISVNAddParameters addParameters) |
If options is null,
then this SVNWCClient 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 SVNWCClient 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
To create and add to version control a new directory, set mkdir
to true.
Calling this method is equivalent to
doAdd(path, force, mkdir, climbUnversionedParents, recursive, false).
Parameters: path a path to be put under version
control (will be added to a repository
in next commit) force true to
force the operation to run mkdir if true -
creates a new directory and schedules it for
addition climbUnversionedParents if true and
path is located in an unversioned
parent directory then the parent will be automatically
scheduled for addition, too recursive true to
descend recursively (relevant for directories)
Throws: SVNException if one of the following is true:
path doesn't belong
to a Working Copy
path doesn't exist and
mkdir is false
path is the root directory of the Working Copy
To create and add to version control a new directory, set mkdir
to true.
Parameters: path a path to be put under version
control (will be added to a repository
in next commit) force true to
force the operation to run mkdir if true -
creates a new directory and schedules it for
addition climbUnversionedParents if true and
path is located in an unversioned
parent directory then the parent will be automatically
scheduled for addition, too recursive true to
descend recursively (relevant for directories) includeIgnored controls whether ignored items must be also added
Throws: SVNException if one of the following is true:
path doesn't belong
to a Working Copy
path doesn't exist and
mkdir is false
path is the root directory of the Working Copy
Since: 1.1
If you ever get a "working copy locked" error, use this method to remove stale locks and get your working copy into a usable state again.
Parameters: path a WC path to start a cleanup from
Throws: SVNException if one of the following is true:
path does not exist
path's parent directory
is not under version control
Parameters: path a WC item to be deleted force true to force the operation to run dryRun true only to try the delete operation without actual deleting
Throws: SVNException if one of the following is true:
path is not under version control
path without forcing
See Also: SVNWCClient
doDelete()
method is similar to the corresponding SVN client's command - 'svn delete'
as it always deletes files from the filesystem.
Parameters: path a WC item to be deleted force true to force the operation to run deleteFiles if true then files will be scheduled for deletion as well as deleted from the filesystem, otherwise files will be only scheduled for addition and still be present in the filesystem dryRun true only to try the delete operation without actual deleting
Throws: SVNException if one of the following is true:
path is not under version control
path without forcing
Parameters: path a Working Copy file item pegRevision a revision in which the file item is first looked up revision a target revision expandKeywords if true then
all keywords presenting in the file and listed in
the file's svn:keywords
property (if set) will be substituted, otherwise not dst the destination where the file contents will be written to
Throws: SVNException if one of the following is true:
path refers to a directory
path does not exist
path is not under version control
See Also: SVNWCClient
Parameters: url a file item's repository location pegRevision a revision in which the file item is first looked up revision a target revision expandKeywords if true then
all keywords presenting in the file and listed in
the file's svn:keywords
property (if set) will be substituted, otherwise not dst the destination where the file contents will be written to
Throws: SVNException if one of the following is true:
url refers to a directory
java.io.File#createTempFile(java.lang.String, java.lang.String) createTempFile()
fails) necessary for file translating
See Also: SVNWCClient
Parameters: path a WC item's path propName an item's property name; if it's null then all the item's properties will be retrieved but only the first of them returned pegRevision a revision in which the item is first looked up revision a target revision; recursive true to descend recursively
Returns: the item's property
Throws: SVNException if one of the following is true:
propName starts
with the svn:wc: prefix
path is not under version control
See Also: SVNWCClient SVNWCClient
Parameters: url an item's repository location propName an item's property name; if it's null then all the item's properties will be retrieved but only the first of them returned pegRevision a revision in which the item is first looked up revision a target revision recursive true to descend recursively
Returns: the item's property
Throws: SVNException if propName starts
with the svn:wc: prefix
See Also: SVNWCClient SVNWCClient
Parameters: path a WC item's path propName an item's property name; if it's
null then
all the item's properties will be retrieved
and passed to handler for
processing pegRevision a revision in which the item is first looked up revision a target revision;
recursive true to
descend recursively handler a caller's property handler
Throws: SVNException if one of the following is true:
propName starts
with the svn:wc: prefix
path is not under version control
See Also: SVNWCClient SVNWCClient
Parameters: url an item's repository location propName an item's property name; if it's
null then
all the item's properties will be retrieved
and passed to handler for
processing pegRevision a revision in which the item is first looked up revision a target revision recursive true to
descend recursively handler a caller's property handler
Throws: SVNException if propName starts
with the svn:wc: prefix
See Also: SVNWCClient SVNWCClient
Parameters: path a local Working Copy item which repository
location is used to connect to a repository propName a revision property name; if this parameter
is null then
all the revision properties will be retrieved
and passed to handler for
processing revision a revision which property is to be retrieved handler a caller's property handler
Throws: SVNException if one of the following is true:
revision is invalid
propName starts with the
svn:wc: prefix
See Also: SVNWCClient SVNWCClient
Parameters: url a URL pointing to a repository location
which revision property is to be got propName a revision property name; if this parameter
is null then
all the revision properties will be retrieved
and passed to handler for
processing revision a revision which property is to be retrieved handler a caller's property handler
Throws: SVNException if one of the following is true:
revision is invalid
propName starts with the
svn:wc: prefix
See Also: SVNWCClient SVNWCClient
A return string has a form of "minR[:maxR][M][S]" where:
minR - is the smallest revision number met in the
Working Copy
maxR - is the biggest revision number met in the
Working Copy; appears only if there are different revision in the
Working Copy
M - appears only if there're local edits to the
Working Copy - that means 'Modified'
S - appears only if the Working Copy is switched
against a different URL
path is a directory - this method recursively descends
into the Working Copy, collects and processes local information.
Parameters: path a local path trailURL optional: if not null
specifies the name of the item that should be met
in the URL corresponding to the repository location
of the path; if that URL ends with something
different than this optional parameter - the Working
Copy will be considered "switched"
Returns: brief info on the Working Copy or the string
"exported" if path is a clean directory
Throws: SVNException if path is neither versioned nor
even exported
If revision is valid and not local,
then information will be collected on remote items (that is taken from
a repository). Otherwise information is gathered on local items not
accessing a repository.
Parameters: path a WC item on which info should be obtained revision a target revision recursive true to descend recursively (relevant for directories) handler a caller's info handler
Throws: SVNException if one of the following is true:
path is not under version control
path to
get its information from the repository - there's no such entry
path is an item that does not exist in
the specified revision
See Also: SVNWCClient SVNWCClient
If revision & pegRevision are valid and not
local, then information will be collected
on remote items (that is taken from a repository). Otherwise information
is gathered on local items not accessing a repository.
Parameters: path a WC item on which info should be obtained pegRevision a revision in which path is first
looked up revision a target revision recursive true to
descend recursively (relevant for directories) handler a caller's info handler
Throws: SVNException if one of the following is true:
path is not under version control
path to
get its information from the repository - there's no such entry
path is an item that does not exist in
the specified revision
See Also: SVNWCClient SVNWCClient
Parameters: url a URL of an item which information is to be obtained and processed pegRevision a revision in which the item is first looked up revision a target revision recursive true to descend recursively (relevant for directories) handler a caller's info handler
Throws: SVNException if url is an item that does not exist in
the specified revision
See Also: SVNWCClient SVNWCClient
If revision is valid and not WORKING
then information will be collected on remote items (that is taken from
a repository). Otherwise information is gathered on local items not
accessing a repository.
Parameters: path a WC item on which info should be obtained revision a target revision
Returns: collected info
Throws: SVNException if one of the following is true:
path is not under version control
path to
get its information from the repository - there's no such entry
path is an item that does not exist in
the specified revision
See Also: SVNWCClient SVNWCClient
Parameters: url a URL of an item which information is to be obtained pegRevision a revision in which the item is first looked up revision a target revision
Returns: collected info
Throws: SVNException if url is an item that does not exist in
the specified revision
See Also: SVNWCClient SVNWCClient
Parameters: paths an array of local WC file paths that should be locked stealLock if true then all existing
locks on the specified paths will be "stolen" lockMessage an optional lock comment
Throws: SVNException if one of the following is true:
paths to be locked belong to different repositories
See Also: (SVNURL[], boolean, String)
Parameters: urls an array of URLs to be locked stealLock if true then all existing
locks on the specified urls will be "stolen" lockMessage an optional lock comment
Throws: SVNException
See Also: (File[], boolean, String)
Parameters: path a WC item to be resolved recursive true to descend recursively (relevant for directories) - this will resolve the entire tree
Throws: SVNException if path is not under version control
Parameters: paths a WC paths to perform a revert on recursive true to descend recursively (relevant for directories)
Throws: SVNException if one of the following is true:
path is not under version control
See Also: (File[], boolean)
Parameters: paths a WC paths to perform a revert on recursive true to descend recursively (relevant for directories)
Throws: SVNException if one of the following is true:
Exception will not be thrown if there are multiple paths passed.
Instead caller should process events received by path is not under version control
ISVNEventHandler
instance to get information on whether certain path was reverted or not.
To set or edit a property simply provide a propName
and a propValue. To delete a property set
propValue to null
and the property propName will be deleted.
Parameters: path a WC item which properties are to be modified propName a property name propValue a property value force true to force the operation to run recursive true to descend recursively handler a caller's property handler
Throws: SVNException if one of the following is true:
propName is a revision
property
propName starts
with the svn:wc: prefix
See Also: SVNWCClient SVNWCClient SVNWCClient
To set or edit a property simply provide a propName
and a propValue. To delete a revision property set
propValue to null
and the property propName will be deleted.
Parameters: path a Working Copy item revision a revision which properties are to be modified propName a property name propValue a property value force true to force the operation to run handler a caller's property handler
Throws: SVNException if one of the following is true:
propName starts
with the svn:wc: prefix
See Also: SVNWCClient SVNWCClient SVNWCClient SVNWCClient
To set or edit a property simply provide a propName
and a propValue. To delete a revision property set
propValue to null
and the property propName will be deleted.
Parameters: url a URL pointing to a repository location revision a revision which properties are to be modified propName a property name propValue a property value force true to force the operation to run handler a caller's property handler
Throws: SVNException if one of the following is true:
propName starts
with the svn:wc: prefix
See Also: SVNWCClient SVNWCClient SVNWCClient SVNWCClient
Parameters: paths an array of local WC file paths that should be unlocked breakLock if true and there are locks that belong to different users then those locks will be also unlocked - that is "broken"
Throws: SVNException if one of the following is true:
breakLock is false
paths to be unlocked belong to different repositories
See Also: (SVNURL[], boolean)
Parameters: urls an array of URLs that should be unlocked breakLock if true and there are locks that belong to different users then those locks will be also unlocked - that is "broken"
Throws: SVNException
See Also: (File[], boolean)