| SVNKit Home | |
| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectorg.tmatesoft.svn.core.wc.SVNBasicClientorg.tmatesoft.svn.core.wc.SVNWCClientpublic class SVNWCClientextends SVNBasicClient| 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' |
ExamplesNested Class Summary |
Nested classes/interfaces inherited from class org.tmatesoft.svn.core.wc.SVNBasicClient | |
SVNBasicClient.RepositoryReference, SVNBasicClient.SVNRepositoryLocation | |
Fields inherited from interface org.tmatesoft.svn.core.wc.ISVNEventHandler | |
UNKNOWN | |
Constructor Summary | |
| |
| |
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
SVNPropertyData |
|
void |
|
SVNPropertyData |
|
void |
|
void |
|
void |
|
String |
|
SVNInfo |
|
void |
|
void |
|
SVNInfo |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
Methods inherited from class org.tmatesoft.svn.core.wc.SVNBasicClient | |
checkCancelled, createRepository, createRepository, createRepository, createWCAccess, createWCAccess, dispatchEvent, dispatchEvent, getDebugLog, getEventDispatcher, getLocations, getOptions, getRepositoryPool, getRevisionNumber, getURL, handleEvent, isIgnoreExternals, isLeaveConflictsUnresolved, setDebugLog, setEventHandler, setEventPathPrefix, setIgnoreExternals, setLeaveConflictsUnresolved, sleepForTimeStamp | |
public SVNWCClient(ISVNAuthenticationManager authManager, ISVNOptions options)
Constructs and initializes an SVNWCClient object with the specified run-time configuration and authentication drivers. Ifoptionsis 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 onISVNOptionsandSVNWCUtil). IfauthManageris null, then this SVNWCClient will be using a default authentication and network layers driver (seeSVNWCUtil.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 driveroptions- a run-time configuration options driver
public void doAdd(File path,
boolean force,
boolean mkdir,
boolean climbUnversionedParents,
boolean recursive)
throws SVNExceptionSchedules an unversioned item for addition to a repository thus putting it under version control. To create and add to version control a new directory, setmkdirto true. Calling this method is equivalent todoAdd(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 runmkdir- if true - creates a new directory and schedules it for additionclimbUnversionedParents- if true andpathis located in an unversioned parent directory then the parent will be automatically scheduled for addition, toorecursive- true to descend recursively (relevant for directories)
- Throws:
SVNException- if one of the following is true:
pathdoesn't belong to a Working Copypathdoesn't exist andmkdiris falsepathis the root directory of the Working Copy
public void doAdd(File path,
boolean force,
boolean mkdir,
boolean climbUnversionedParents,
boolean recursive,
boolean includeIgnored)
throws SVNExceptionSchedules an unversioned item for addition to a repository thus putting it under version control. To create and add to version control a new directory, setmkdirto 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 runmkdir- if true - creates a new directory and schedules it for additionclimbUnversionedParents- if true andpathis located in an unversioned parent directory then the parent will be automatically scheduled for addition, toorecursive- 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:
pathdoesn't belong to a Working Copypathdoesn't exist andmkdiris falsepathis the root directory of the Working Copy
- Since:
- 1.1
public void doCleanup(File path)
throws SVNExceptionRecursively cleans up the working copy, removing locks and resuming unfinished operations. 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:
pathdoes not existpath's parent directory is not under version control
public void doDelete(File path,
boolean force,
boolean dryRun)
throws SVNExceptionSchedules a Working Copy item for deletion.
- Parameters:
path- a WC item to be deletedforce- true to force the operation to rundryRun- true only to try the delete operation without actual deleting
- Throws:
SVNException- if one of the following is true:
pathis not under version control- can not delete
pathwithout forcing
public void doDelete(File path,
boolean force,
boolean deleteFiles,
boolean dryRun)
throws SVNExceptionSchedules a Working Copy item for deletion. This method allows to choose - whether file item(s) are to be deleted from the filesystem or not. Another version of thedoDelete()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 deletedforce- true to force the operation to rundeleteFiles- 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 filesystemdryRun- true only to try the delete operation without actual deleting
- Throws:
SVNException- if one of the following is true:
pathis not under version control- can not delete
pathwithout forcing
public void doGetFileContents(File path,
SVNRevision pegRevision,
SVNRevision revision,
boolean expandKeywords,
OutputStream dst)
throws SVNExceptionGets contents of a file. Ifrevision is one of: then the file contents are taken from the Working Copy file item. Otherwise the file item's contents are taken from the repository at a particular revision.
- Parameters:
path- a Working Copy file itempegRevision- a revision in which the file item is first looked uprevision- a target revisionexpandKeywords- if true then all keywords presenting in the file and listed in the file'ssvn:keywordsproperty (if set) will be substituted, otherwise notdst- the destination where the file contents will be written to
- Throws:
SVNException- if one of the following is true:
pathrefers to a directorypathdoes not existpathis not under version control
public void doGetFileContents(SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean expandKeywords, OutputStream dst) throws SVNException
Gets contents of a file of a particular revision from a repository.
- Parameters:
url- a file item's repository locationpegRevision- a revision in which the file item is first looked uprevision- a target revisionexpandKeywords- if true then all keywords presenting in the file and listed in the file'ssvn:keywordsproperty (if set) will be substituted, otherwise notdst- the destination where the file contents will be written to
- Throws:
SVNException- if one of the following is true:
urlrefers to a directory- it's impossible to create temporary files (
createTempFile()fails) necessary for file translating
public SVNPropertyData doGetProperty(File path, String propName, SVNRevision pegRevision, SVNRevision revision, boolean recursive) throws SVNException
Gets an item's versioned property. It's possible to get either a local property (from a Working Copy) or a remote one (located in a repository). Ifrevision is one of: then the result is a WC item's property. Otherwise the property is taken from a repository (using the item's URL).
- Parameters:
path- a WC item's pathpropName- an item's property name; if it's null then all the item's properties will be retrieved but only the first of them returnedpegRevision- a revision in which the item is first looked uprevision- a target revision;recursive- true to descend recursively
- Returns:
- the item's property
- Throws:
SVNException- if one of the following is true:
propNamestarts with thesvn:wc:prefixpathis not under version control
public void doGetProperty(File path,
String propName,
SVNRevision pegRevision,
SVNRevision revision,
boolean recursive,
ISVNPropertyHandler handler)
throws SVNExceptionGets an item's versioned property and passes it to a provided property handler. It's possible to get either a local property (from a Working Copy) or a remote one (located in a repository). Ifrevision is one of: then the result is a WC item's property. Otherwise the property is taken from a repository (using the item's URL).
- Parameters:
path- a WC item's pathpropName- an item's property name; if it's null then all the item's properties will be retrieved and passed tohandlerfor processingpegRevision- a revision in which the item is first looked uprevision- a target revision;recursive- true to descend recursivelyhandler- a caller's property handler
- Throws:
SVNException- if one of the following is true:
propNamestarts with thesvn:wc:prefixpathis not under version control
public SVNPropertyData doGetProperty(SVNURL url, String propName, SVNRevision pegRevision, SVNRevision revision, boolean recursive) throws SVNException
Gets an item's versioned property from a repository. This method is useful when having no Working Copy at all.
- Parameters:
url- an item's repository locationpropName- an item's property name; if it's null then all the item's properties will be retrieved but only the first of them returnedpegRevision- a revision in which the item is first looked uprevision- a target revisionrecursive- true to descend recursively
- Returns:
- the item's property
- Throws:
SVNException- ifpropNamestarts with thesvn:wc:prefix
public void doGetProperty(SVNURL url, String propName, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNPropertyHandler handler) throws SVNException
Gets an item's versioned property from a repository and passes it to a provided property handler. This method is useful when having no Working Copy at all.
- Parameters:
url- an item's repository locationpropName- an item's property name; if it's null then all the item's properties will be retrieved and passed tohandlerfor processingpegRevision- a revision in which the item is first looked uprevision- a target revisionrecursive- true to descend recursivelyhandler- a caller's property handler
- Throws:
SVNException- ifpropNamestarts with thesvn:wc:prefix
public void doGetRevisionProperty(File path,
String propName,
SVNRevision revision,
ISVNPropertyHandler handler)
throws SVNExceptionGets an unversioned revision property from a repository (getting a repository URL from a Working Copy) and passes it to a provided property handler.
- Parameters:
path- a local Working Copy item which repository location is used to connect to a repositorypropName- a revision property name; if this parameter is null then all the revision properties will be retrieved and passed tohandlerfor processingrevision- a revision which property is to be retrievedhandler- a caller's property handler
- Throws:
SVNException- if one of the following is true:
revisionis invalidpropNamestarts with thesvn:wc:prefix
public void doGetRevisionProperty(SVNURL url, String propName, SVNRevision revision, ISVNPropertyHandler handler) throws SVNException
Gets an unversioned revision property from a repository and passes it to a provided property handler.
- Parameters:
url- a URL pointing to a repository location which revision property is to be gotpropName- a revision property name; if this parameter is null then all the revision properties will be retrieved and passed tohandlerfor processingrevision- a revision which property is to be retrievedhandler- a caller's property handler
- Throws:
SVNException- if one of the following is true:
revisionis invalidpropNamestarts with thesvn:wc:prefix
public String doGetWorkingCopyID(File path,
String trailURL)
throws SVNExceptionReturns the current Working Copy min- and max- revisions as well as changes and switch status within a single string. A return string has a form of"minR[:maxR][M][S]"where:If
minR- is the smallest revision number met in the Working CopymaxR- is the biggest revision number met in the Working Copy; appears only if there are different revision in the Working CopyM- 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 URLpathis a directory - this method recursively descends into the Working Copy, collects and processes local information.
- Parameters:
path- a local pathtrailURL- optional: if not null specifies the name of the item that should be met in the URL corresponding to the repository location of thepath; 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
pathis a clean directory
- Throws:
SVNException- ifpathis neither versioned nor even exported
public SVNInfo doInfo(File path, SVNRevision revision) throws SVNException
Collects and returns information on a single Working Copy item. Ifrevisionis valid and notWORKINGthen 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 obtainedrevision- a target revision
- Returns:
- collected info
- Throws:
SVNException- if one of the following is true:
pathis not under version control- can not obtain a URL corresponding to
pathto get its information from the repository - there's no such entry- if a remote info:
pathis an item that does not exist in the specifiedrevision
public void doInfo(File path,
SVNRevision revision,
boolean recursive,
ISVNInfoHandler handler)
throws SVNExceptionCollects information about Working Copy item(s) and passes it to an info handler. Ifrevisionis 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 obtainedrevision- a target revisionrecursive- true to descend recursively (relevant for directories)handler- a caller's info handler
- Throws:
SVNException- if one of the following is true:
pathis not under version control- can not obtain a URL corresponding to
pathto get its information from the repository - there's no such entry- if a remote info:
pathis an item that does not exist in the specifiedrevision
public void doInfo(File path,
SVNRevision pegRevision,
SVNRevision revision,
boolean recursive,
ISVNInfoHandler handler)
throws SVNExceptionCollects information about Working Copy item(s) and passes it to an info handler. Ifrevision&pegRevisionare 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 obtainedpegRevision- a revision in whichpathis first looked uprevision- a target revisionrecursive- true to descend recursively (relevant for directories)handler- a caller's info handler
- Throws:
SVNException- if one of the following is true:
pathis not under version control- can not obtain a URL corresponding to
pathto get its information from the repository - there's no such entry- if a remote info:
pathis an item that does not exist in the specifiedrevision
public SVNInfo doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision) throws SVNException
Collects and returns information on a single item in a repository.
- Parameters:
url- a URL of an item which information is to be obtainedpegRevision- a revision in which the item is first looked uprevision- a target revision
- Returns:
- collected info
- Throws:
SVNException- ifurlis an item that does not exist in the specifiedrevision
public void doInfo(SVNURL url, SVNRevision pegRevision, SVNRevision revision, boolean recursive, ISVNInfoHandler handler) throws SVNException
Collects information about item(s) in a repository and passes it to an info handler.
- Parameters:
url- a URL of an item which information is to be obtained and processedpegRevision- a revision in which the item is first looked uprevision- a target revisionrecursive- true to descend recursively (relevant for directories)handler- a caller's info handler
- Throws:
SVNException- ifurlis an item that does not exist in the specifiedrevision
public void doLock(File[] paths,
boolean stealLock,
String lockMessage)
throws SVNExceptionLocks file items in a Working Copy as well as in a repository so that no other user can commit changes to them.
- Parameters:
paths- an array of local WC file paths that should be lockedstealLock- if true then all existing locks on the specifiedpathswill be "stolen"lockMessage- an optional lock comment
- Throws:
SVNException- if one of the following is true:
- a path to be locked is not under version control
- can not obtain a URL of a local path to lock it in the repository - there's no such entry
pathsto be locked belong to different repositories
- See Also:
doLock(SVNURL[],boolean,String)
public void doLock(SVNURL[] urls, boolean stealLock, String lockMessage) throws SVNException
Locks file items in a repository so that no other user can commit changes to them.
- Parameters:
urls- an array of URLs to be lockedstealLock- if true then all existing locks on the specifiedurlswill be "stolen"lockMessage- an optional lock comment
- Throws:
SVNException-
- See Also:
doLock(File[],boolean,String)
public void doResolve(File path,
boolean recursive)
throws SVNExceptionResolves a 'conflicted' state on a Working Copy item.
- Parameters:
path- a WC item to be resolvedrecursive- true to descend recursively (relevant for directories) - this will resolve the entire tree
- Throws:
SVNException- ifpathis not under version control
public void doRevert(File path,
boolean recursive)
throws SVNExceptionReverts all local changes made to a Working Copy item(s) thus bringing it to a 'pristine' state.
- Parameters:
path- a WC path to perform a revert onrecursive- true to descend recursively (relevant for directories)
- Throws:
SVNException- if one of the following is true:
pathis not under version control- when trying to revert an addition of a directory from within the directory itself
public void doSetProperty(File path,
String propName,
String propValue,
boolean force,
boolean recursive,
ISVNPropertyHandler handler)
throws SVNExceptionSets, edits or deletes a property on a file or directory item(s). To set or edit a property simply provide apropNameand apropValue. To delete a property setpropValueto null and the propertypropNamewill be deleted.
- Parameters:
path- a WC item which properties are to be modifiedpropName- a property namepropValue- a property valueforce- true to force the operation to runrecursive- true to descend recursivelyhandler- a caller's property handler
- Throws:
SVNException- if one of the following is true:
propNameis a revision propertypropNamestarts with thesvn:wc:prefix
public void doSetRevisionProperty(File path,
SVNRevision revision,
String propName,
String propValue,
boolean force,
ISVNPropertyHandler handler)
throws SVNExceptionSets, edits or deletes an unversioned revision property. This method uses a Working Copy item to obtain the URL of the repository which revision properties are to be changed. To set or edit a property simply provide apropNameand apropValue. To delete a revision property setpropValueto null and the propertypropNamewill be deleted.
- Parameters:
path- a Working Copy itemrevision- a revision which properties are to be modifiedpropName- a property namepropValue- a property valueforce- true to force the operation to runhandler- a caller's property handler
- Throws:
SVNException- if one of the following is true:
- the operation can not be performed without forcing
propNamestarts with thesvn:wc:prefix
public void doSetRevisionProperty(SVNURL url, SVNRevision revision, String propName, String propValue, boolean force, ISVNPropertyHandler handler) throws SVNException
Sets, edits or deletes an unversioned revision property. This method uses a URL pointing to a repository which revision properties are to be changed. To set or edit a property simply provide apropNameand apropValue. To delete a revision property setpropValueto null and the propertypropNamewill be deleted.
- Parameters:
url- a URL pointing to a repository locationrevision- a revision which properties are to be modifiedpropName- a property namepropValue- a property valueforce- true to force the operation to runhandler- a caller's property handler
- Throws:
SVNException- if one of the following is true:
- the operation can not be performed without forcing
propNamestarts with thesvn:wc:prefix
public void doUnlock(File[] paths,
boolean breakLock)
throws SVNExceptionUnlocks file items in a Working Copy as well as in a repository.
- Parameters:
paths- an array of local WC file paths that should be unlockedbreakLock- 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:
- a path is not under version control
- can not obtain a URL of a local path to unlock it in the repository - there's no such entry
- if a path is not locked in the Working Copy and
breakLockis falsepathsto be unlocked belong to different repositories
- See Also:
doUnlock(SVNURL[],boolean)
public void doUnlock(SVNURL[] urls, boolean breakLock) throws SVNException
Unlocks file items in a repository.
- Parameters:
urls- an array of URLs that should be unlockedbreakLock- 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:
doUnlock(File[],boolean)