Class SVNRepositoryImpl
- All Implemented Interfaces:
ISVNReporter
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final java.lang.Stringprivate static final java.lang.Stringprivate static final java.lang.Stringprivate static final java.lang.Stringprivate static final java.lang.Stringprivate static final java.lang.Stringprivate SVNConnectionprivate java.lang.Stringprivate java.lang.StringFields inherited from class org.tmatesoft.svn.core.io.SVNRepository
INVALID_REVISION, myLocation, myRepositoryRoot, myRepositoryUUID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAborts the current running report due to errors occured.(package private) voidcheckPath(java.lang.String path, long revision) Returns the kind of an item located at the specified path in a particular revision.protected voidvoidCloses the current session closing a socket connection used by this object.voiddeletePath(java.lang.String path) Describes a working copypathas deleted or missing.voiddiff(SVNURL url, long targetRevision, long revision, java.lang.String target, boolean ignoreAncestry, SVNDepth depth, boolean getContents, ISVNReporterBaton reporter, ISVNEditor editor) Asks this repository access object to 'diff' a working copy againsttargetRevision.private static java.lang.StringensureAbsolutePath(java.lang.String path) voidFinalizes the report.getCommitEditor(java.lang.String logMessage, java.util.Map locks, boolean keepLocks, ISVNWorkspaceMediator mediator) Gets an editor for committing changes to a repository.protected ISVNEditorgetCommitEditorInternal(java.util.Map locks, boolean keepLocks, SVNProperties revProps, ISVNWorkspaceMediator mediator) longgetDatedRevision(java.util.Date date) Returns the recent repository revision number for the particular moment in time - the closest one before or at the specified datestamp.protected longgetDeletedRevisionImpl(java.lang.String path, long pegRevision, long endRevision) private ISVNEditorgetDepthFilterEditor(ISVNEditor editor, SVNDepth depth, boolean hasTarget) getDir(java.lang.String path, long revision, boolean includeComment, java.util.Collection entries) Fetches the contents of a directory into the provided collection object and returns the directory entry itself.longgetDir(java.lang.String path, long revision, SVNProperties properties, int entryFields, ISVNDirEntryHandler handler) Fetches the contents and/or properties of a directory located at the specified path in a particular revision with the possibility to specify fields of the entry to fetch.longgetDir(java.lang.String path, long revision, SVNProperties properties, ISVNDirEntryHandler handler) Fetches the contents and/or properties of a directory located at the specified path in a particular revision.java.lang.StringlonggetFile(java.lang.String path, long revision, SVNProperties properties, java.io.OutputStream contents) Fetches the contents and/or properties of a file located at the specified path in a particular revision.protected intgetFileRevisionsImpl(java.lang.String path, long startRevision, long endRevision, boolean includeMergedRevisions, ISVNFileRevisionHandler handler) protected voidgetInheritedPropertiesImpl(java.lang.String path, long revision, java.lang.String propertyName, ISVNInheritedPropertiesHandler handler) longReturns the number of the latest revision of the repository this driver is working with.protected longgetLocationSegmentsImpl(java.lang.String path, long pegRevision, long startRevision, long endRevision, ISVNLocationSegmentHandler handler) protected intgetLocationsImpl(java.lang.String path, long pegRevision, long[] revisions, ISVNLocationEntryHandler handler) getLock(java.lang.String path) Gets the lock for the file located at the specified path.SVNLock[]getLocks(java.lang.String path) Gets all locks on or below thepath, that is if the repository entry (located at thepath) is a directory then the method returns locks of all locked files (if any) in it.protected java.util.MapgetMergeInfoImpl(java.lang.String[] paths, long revision, SVNMergeInfoInheritance inherit, boolean includeDescendants) java.lang.StringgetRealm()private static booleangetRecurseFromDepth(SVNDepth depth) private java.lang.String[]getRepositoryPaths(java.lang.String[] paths) getRevisionProperties(long revision, SVNProperties properties) Returns unversioned revision properties for a particular revision.getRevisionPropertyValue(long revision, java.lang.String propertyName) Gets the value of an unversioned property.private voidhandleUnsupportedCommand(SVNException e, java.lang.String message) booleanhasCapability(SVNCapability capability) Returnstrueif the repository has specifiedcapability.info(java.lang.String path, long revision) Gives information about an entry located at the specified path in a particular revision.voidlinkPath(SVNURL url, java.lang.String path, java.lang.String lockToken, long revision, boolean startEmpty) Describes a local path as being at a particular revision to switch the path to a different repository location.voidlinkPath(SVNURL url, java.lang.String path, java.lang.String lockToken, long revision, SVNDepth depth, boolean startEmpty) Describes a local path as being at a particular revision to switch the path to a different repository location.voidlock(java.util.Map pathsToRevisions, java.lang.String comment, boolean force, ISVNLockHandler handler) Locks path(s) at definite revision(s).private voidlock12(java.util.Map pathsToRevisions, java.lang.String comment, boolean force, ISVNLockHandler handler) protected longlogImpl(java.lang.String[] targetPaths, long startRevision, long endRevision, boolean changedPaths, boolean strictNode, long limit, boolean includeMergedRevisions, java.lang.String[] revisionPropertyNames, ISVNLogEntryHandler handler) protected voidprivate java.util.Listread(java.lang.String template, java.util.List values, boolean readMalformedData) private SVNItemreadItem(boolean readMalformedData) private java.util.ListreadTuple(java.lang.String template, boolean readMalformedData) private booleanvoidreplay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) Replays the changes from the specified revision through the given editor.protected voidreplayRangeImpl(long startRevision, long endRevision, long lowRevision, boolean sendDeltas, ISVNReplayHandler handler) voidsetExternalUserName(java.lang.String userName) voidsetLocation(SVNURL url, boolean forceReconnect) Sets a new repository location for this object.voidsetPath(java.lang.String path, java.lang.String lockToken, long revision, boolean startEmpty) Describes a local path as being at a particular revision.voidsetPath(java.lang.String path, java.lang.String lockToken, long revision, SVNDepth depth, boolean startEmpty) Describes a working copypathas being at a particularrevisionand having depthdepth.voidsetRevisionPropertyValue(long revision, java.lang.String propertyName, SVNPropertyValue propertyValue) Sets a revision property with the specified name to a new value.voidstatus(long revision, java.lang.String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) Gets status of a path to the particulardepthas a scope.voidTries to access a repository.voidunlock(java.util.Map pathToTokens, boolean force, ISVNLockHandler handler) Removes lock(s) from the file(s).private voidunlock12(java.util.Map pathToTokens, boolean force, ISVNLockHandler handler) voidupdate(long revision, java.lang.String target, SVNDepth depth, boolean sendCopyFromArgs, ISVNReporterBaton reporter, ISVNEditor editor) Updates a path receiving changes from a repository.voidupdate(SVNURL url, long revision, java.lang.String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) Asks this repository access object to 'switch' a versioned tree to a newurl.(package private) voidupdateCredentials(java.lang.String uuid, SVNURL rootURL) private voidwrite(java.lang.String template, java.lang.Object[] values) Methods inherited from class org.tmatesoft.svn.core.io.SVNRepository
addConnectionListener, assertServerIsMergeInfoCapable, assertValidRevision, checkout, checkout, checkoutFiles, diff, diff, diff, fireConnectionClosed, fireConnectionOpened, getAuthenticationManager, getCanceller, getCommitEditor, getCommitEditor, getDebugLog, getDeletedRevision, getDir, getDir, getFileRevisions, getFileRevisions, getFileRevisions, getFullPath, getInheritedProperties, getInheritedProperties, getLocation, getLocationRelativePath, getLocations, getLocations, getLocations, getLocationSegments, getLocationSegments, getMergeInfo, getOptions, getRepositoryPath, getRepositoryRoot, getRepositoryRoot, getRepositoryUUID, getRepositoryUUID, getRevisionObject, getTunnelProvider, isInvalidRevision, isValidRevision, lock, lock, log, log, log, log, removeConnectionListener, replayRange, setAuthenticationManager, setCanceller, setDebugLog, setRepositoryCredentials, setTunnelProvider, status, unlock, update, updateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
DIRENT_KIND
private static final java.lang.String DIRENT_KIND- See Also:
-
DIRENT_SIZE
private static final java.lang.String DIRENT_SIZE- See Also:
-
DIRENT_HAS_PROPS
private static final java.lang.String DIRENT_HAS_PROPS- See Also:
-
DIRENT_CREATED_REV
private static final java.lang.String DIRENT_CREATED_REV- See Also:
-
DIRENT_TIME
private static final java.lang.String DIRENT_TIME- See Also:
-
DIRENT_LAST_AUTHOR
private static final java.lang.String DIRENT_LAST_AUTHOR- See Also:
-
myConnection
-
myRealm
private java.lang.String myRealm -
myExternalUserName
private java.lang.String myExternalUserName
-
-
Constructor Details
-
SVNRepositoryImpl
-
-
Method Details
-
testConnection
Description copied from class:SVNRepositoryTries to access a repository. Used to check if there're no problems with accessing a repository and to cache a repository UUID and root directory location.- Specified by:
testConnectionin classSVNRepository- Throws:
SVNException- if a failure occured while connecting to a repository or the user's authentication failed (seeSVNAuthenticationException)
-
setLocation
Description copied from class:SVNRepositorySets a new repository location for this object. The ability to reset an old repository location to a new one (to switch the working location) lets a developer to use the same SVNRepository object instead of creating a new object per each repository location. This advantage gives memory & coding efforts economy.But you can not specify a new repository location url with a protocol different from the one used for the previous (essentially, the current) repository location, since SVNRepository objects are protocol dependent.
If a new
urlis located within the same repository, this object just switches to thaturlnot closing the current session (i.e. not callingSVNRepository.closeSession()).If either a new
urlrefers to the same host (including a port number), or refers to an absolutely different host, or this object has got no repository root location cached (hasn't ever accessed a repository yet), orforceReconnectis true, then the current session is closed, cached repository credentials (UUID and repository root directory location ) are reset and this object is switched to a new repository location.- Overrides:
setLocationin classSVNRepository- Parameters:
url- a new repository location urlforceReconnect- if true then forces to close the current session, resets the cached repository credentials and switches this object to a new location (doesn't matter whether it's on the same host or not)- Throws:
SVNException- if the old url and a new one has got different protocols
-
reparent
- Throws:
SVNException
-
getLatestRevision
Description copied from class:SVNRepositoryReturns the number of the latest revision of the repository this driver is working with.- Specified by:
getLatestRevisionin classSVNRepository- Returns:
- the latest revision number
- Throws:
SVNException- if a failure occured while connecting to a repository or the user's authentication failed (seeSVNAuthenticationException)
-
getDatedRevision
Description copied from class:SVNRepositoryReturns the recent repository revision number for the particular moment in time - the closest one before or at the specified datestamp.Example: if you specify a single date without specifying a time of the day (e.g. 2002-11-27) the timestamp is assumed to 00:00:00 and the method won't return any revisions for the day you have specified but for the day just before it.
- Specified by:
getDatedRevisionin classSVNRepository- Parameters:
date- a datestamp for defining the needed moment in time- Returns:
- the revision of the repository for that time
- Throws:
SVNException- if a failure occured while connecting to a repository or the user's authentication failed (seeSVNAuthenticationException)
-
getRevisionProperties
public SVNProperties getRevisionProperties(long revision, SVNProperties properties) throws SVNException Description copied from class:SVNRepositoryReturns unversioned revision properties for a particular revision. Property names (keys) are mapped to their values. You may use SVNRevisionProperty constants to retrieve property values from the map.- Specified by:
getRevisionPropertiesin classSVNRepository- Parameters:
revision- a revision numberproperties- if not null then properties will be placed in this map, otherwise a new map will be created- Returns:
- a map containing unversioned revision properties
- Throws:
SVNException- in the following cases:revisionnumber is invalid- there's no such
revisionat all - a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
getRevisionPropertyValue
public SVNPropertyValue getRevisionPropertyValue(long revision, java.lang.String propertyName) throws SVNException Description copied from class:SVNRepositoryGets the value of an unversioned property.- Specified by:
getRevisionPropertyValuein classSVNRepository- Parameters:
revision- a revision numberpropertyName- a property name- Returns:
- a revision property value or null if there's no such revision property
- Throws:
SVNException- in the following cases:revisionnumber is invalid or if there's no suchrevisionat all.- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
-
checkPath
Description copied from class:SVNRepositoryReturns the kind of an item located at the specified path in a particular revision. If thepathdoes not exist under the specifiedrevision,SVNNodeKind.NONEwill be returned.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").- Specified by:
checkPathin classSVNRepository- Parameters:
path- an item's pathrevision- a revision number- Returns:
- the node kind for the given
pathat the givenrevision - Throws:
SVNException- if a failure occured while connecting to a repository or the user's authentication failed (seeSVNAuthenticationException)
-
getLocationsImpl
protected int getLocationsImpl(java.lang.String path, long pegRevision, long[] revisions, ISVNLocationEntryHandler handler) throws SVNException - Specified by:
getLocationsImplin classSVNRepository- Throws:
SVNException
-
getLocationSegmentsImpl
protected long getLocationSegmentsImpl(java.lang.String path, long pegRevision, long startRevision, long endRevision, ISVNLocationSegmentHandler handler) throws SVNException - Specified by:
getLocationSegmentsImplin classSVNRepository- Throws:
SVNException
-
getFile
public long getFile(java.lang.String path, long revision, SVNProperties properties, java.io.OutputStream contents) throws SVNException Description copied from class:SVNRepositoryFetches the contents and/or properties of a file located at the specified path in a particular revision.If
contentsarg is not null it will be written with file contents.If
propertiesarg is not null it will receive the properties of the file. This includes all properties: not just ones controlled by a user and stored in the repository filesystem, but also non-tweakable ones (e.g. 'wcprops', 'entryprops', etc.). Property names (keys) are mapped to property values.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").If
revisionis invalid (negative), HEAD revision will be used.- Specified by:
getFilein classSVNRepository- Parameters:
path- a file pathrevision- a file revisionproperties- a file properties receiver mapcontents- an output stream to write the file contents to- Returns:
- the revision the file has been taken at
- Throws:
SVNException- in the following cases:- there's no such
pathinrevision - a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- there's no such
-
getDir
public long getDir(java.lang.String path, long revision, SVNProperties properties, ISVNDirEntryHandler handler) throws SVNException Description copied from class:SVNRepositoryFetches the contents and/or properties of a directory located at the specified path in a particular revision.This method is the same as
SVNRepository.getDir(String, long, SVNProperties, int, ISVNDirEntryHandler)withentryFieldsparameter set toDIRENT_ALL.- Specified by:
getDirin classSVNRepository- Parameters:
path- a directory pathrevision- a directory revisionproperties- a directory properties receiver maphandler- a handler to process directory entries- Returns:
- the revision of the directory
- Throws:
SVNException- in the following cases:pathnot found in the specifiedrevisionpathis not a directory- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
getDir
public long getDir(java.lang.String path, long revision, SVNProperties properties, int entryFields, ISVNDirEntryHandler handler) throws SVNException Description copied from class:SVNRepositoryFetches the contents and/or properties of a directory located at the specified path in a particular revision with the possibility to specify fields of the entry to fetch.If
handlerarg is not null it will be dispatched information of each directory entry represented by an SVNDirEntry object.If
propertiesarg is not null it will receive the properties of the file. This includes all properties: not just ones controlled by a user and stored in the repository filesystem, but also non-tweakable ones (e.g. 'wcprops', 'entryprops', etc.). Property names (keys) are mapped to property values.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").If
revisionis invalid (negative), HEAD revision will be used. NOTE: you may not invoke operation methods of this SVNRepository object from within the providedhandler.- Specified by:
getDirin classSVNRepository- Parameters:
path- a directory pathrevision- a directory revisionproperties- a directory properties receiver mapentryFields- a combination of fields for the entryhandler- a handler to process directory entries- Returns:
- the revision of the directory
- Throws:
SVNException- in the following cases:pathnot found in the specifiedrevisionpathis not a directory- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
getDir
public SVNDirEntry getDir(java.lang.String path, long revision, boolean includeComment, java.util.Collection entries) throws SVNException Description copied from class:SVNRepositoryFetches the contents of a directory into the provided collection object and returns the directory entry itself.If
entriesarg is not null it receives the directory entries. Information of each directory entry is represented by an SVNDirEntry object.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").- Specified by:
getDirin classSVNRepository- Parameters:
path- a directory pathrevision- a revision numberincludeComment- if true then dir entries (SVNDirEntry objects) will be supplied with commit log messages, otherwise notentries- a collection that receives fetched dir entries- Returns:
- the directory entry itself which contents
are fetched into
entries - Throws:
SVNException- in the following cases:pathnot found in the specifiedrevisionpathis not a directory- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
getFileRevisionsImpl
protected int getFileRevisionsImpl(java.lang.String path, long startRevision, long endRevision, boolean includeMergedRevisions, ISVNFileRevisionHandler handler) throws SVNException - Specified by:
getFileRevisionsImplin classSVNRepository- Throws:
SVNException
-
logImpl
protected long logImpl(java.lang.String[] targetPaths, long startRevision, long endRevision, boolean changedPaths, boolean strictNode, long limit, boolean includeMergedRevisions, java.lang.String[] revisionPropertyNames, ISVNLogEntryHandler handler) throws SVNException - Specified by:
logImplin classSVNRepository- Throws:
SVNException
-
replay
public void replay(long lowRevision, long highRevision, boolean sendDeltas, ISVNEditor editor) throws SVNException Description copied from class:SVNRepositoryReplays the changes from the specified revision through the given editor.Changes will be limited to those that occur under a session's URL, and the server will assume that the client has no knowledge of revisions prior to a
lowRevision. These two limiting factors define the portion of the tree that the server will assume the client already has knowledge of, and thus any copies of data from outside that part of the tree will be sent in their entirety, not as simple copies or deltas against a previous version.If
sendDeltasis true, the actual text and property changes in the revision will be sent, otherwise no text deltas and null property changes will be sent instead.If
lowRevisionis invalid, it defaults to 0.- Specified by:
replayin classSVNRepository- Parameters:
lowRevision- a low revision point beyond which a client has no knowledge of paths historyhighRevision- a revision to replaysendDeltas- controls whether text and property changes are to be senteditor- a commit editor to receive changes- Throws:
SVNException- in case the repository could not be connectedSVNAuthenticationException- in case of authentication problems
-
setRevisionPropertyValue
public void setRevisionPropertyValue(long revision, java.lang.String propertyName, SVNPropertyValue propertyValue) throws SVNException Description copied from class:SVNRepositorySets a revision property with the specified name to a new value.NOTE: revision properties are not versioned. So, the old values may be lost forever.
- Specified by:
setRevisionPropertyValuein classSVNRepository- Parameters:
revision- the number of the revision which property is to be changedpropertyName- a revision property namepropertyValue- the value of the revision property- Throws:
SVNException- in the following cases:- the repository is configured not to allow clients to modify revision properties (e.g. a pre-revprop-change-hook program is not found or failed)
revisionis invalid or doesn't exist at all- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
getCommitEditor
public ISVNEditor getCommitEditor(java.lang.String logMessage, java.util.Map locks, boolean keepLocks, ISVNWorkspaceMediator mediator) throws SVNException Description copied from class:SVNRepositoryGets an editor for committing changes to a repository. Having got the editor traverse a local tree of dirs and/or files to be committed, handling them with corresponding methods of the editor.locksis a map used to provide lock tokens on the locked paths. Keys are locked paths in a local tree, and each value for a key is a lock token.locksmust live during the whole commit operation.If
keepLocksis true, then the locked paths won't be unlocked after a successful commit. Otherwise, if false, locks will be automatically released.mediatoris used for temporary delta data storage allocations.The root path of the commit is the current repository location to which this object is set.
After the commit has succeeded
ISVNEditor.closeEdit()returns an SVNCommitInfo object that contains a new revision number, the commit date, commit author.NOTE: you may not invoke methods of this SVNRepository object from within the returned commit editor.
- Specified by:
getCommitEditorin classSVNRepository- Parameters:
logMessage- a commit log messagelocks- a map containing locked paths mapped to lock tokenskeepLocks- true to keep existing locks; false to release locks after the commitmediator- temp delta storage provider; used also to cache wcprops while committing- Returns:
- an editor to commit a local tree of dirs and/or files
- Throws:
SVNException- in the following cases:- the repository location this object is set to is not a directory
- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
getLock
Description copied from class:SVNRepositoryGets the lock for the file located at the specified path. If the file has no lock the method returns null.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").- Specified by:
getLockin classSVNRepository- Parameters:
path- a file path- Returns:
- an SVNLock instance (representing the lock) or null if there's no lock
- Throws:
SVNException- in the following cases:- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
getLocks
Description copied from class:SVNRepositoryGets all locks on or below thepath, that is if the repository entry (located at thepath) is a directory then the method returns locks of all locked files (if any) in it.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").- Specified by:
getLocksin classSVNRepository- Parameters:
path- a path under which locks are to be retrieved- Returns:
- an array of SVNLock objects (representing locks)
- Throws:
SVNException- in the following cases:- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
lock
public void lock(java.util.Map pathsToRevisions, java.lang.String comment, boolean force, ISVNLockHandler handler) throws SVNException Description copied from class:SVNRepositoryLocks path(s) at definite revision(s).Note that locking is never anonymous, so any server implementing this function will have to "pull" a username from the client, if it hasn't done so already.
Each path to be locked is handled with the provided
handler. If a path was successfully locked, thehandler'shandleLock()is called that receives the path and either a lock object (representing the lock that was set on the path) or an error exception, if locking failed for that path.If any path is already locked by a different user and the
forceflag is false, then this call fails with throwing an SVNException. But ifforceis true, then the existing lock(s) will be "stolen" anyway, even if the user name does not match the current lock's owner.Paths can be both relative to the location of this driver and absolute to the repository root (starting with
"/").- Specified by:
lockin classSVNRepository- Parameters:
pathsToRevisions- a map which keys are paths and values are revision numbers (as Longs); paths are strings and revision numbers are Long objectscomment- a comment string for the lock (optional)force- true if the file is to be locked in any way (even if it's already locked by someone else)handler- if not null, the lock handler is invoked on each path to be locked- Throws:
SVNException- in the following cases:forceis false and a path is already locked by someone else- a revision of a path is less than its last changed revision
- a path does not exist in the latest revision
- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
lock12
private void lock12(java.util.Map pathsToRevisions, java.lang.String comment, boolean force, ISVNLockHandler handler) throws SVNException - Throws:
SVNException
-
unlock
public void unlock(java.util.Map pathToTokens, boolean force, ISVNLockHandler handler) throws SVNException Description copied from class:SVNRepositoryRemoves lock(s) from the file(s).Note that unlocking is never anonymous, so any server implementing this function will have to "pull" a username from the client, if it hasn't done so already.
Each path to be unlocked is handled with the provided
handler. If a path was successfully unlocked, thehandler'shandleUnlock()is called that receives the path and either a lock object (representing the lock that was removed from the path) or an error exception, if unlocking failed for that path.If the username doesn't match the lock's owner and
forceis false, this method call fails with throwing an SVNException. But if theforceflag is true, the lock will be "broken" by the current user.Also if the lock token is incorrect or null and
forceis false, the method fails with throwing a SVNException. However, ifforceis true the lock will be removed anyway.Paths can be both relative to the location of this driver and absolute to the repository root (starting with
"/").- Specified by:
unlockin classSVNRepository- Parameters:
pathToTokens- a map which keys are file paths and values are file lock tokens (both keys and values are strings)force- true to remove the lock in any case - i.e. to "break" the lockhandler- if not null, the lock handler is invoked on each path to be unlocked- Throws:
SVNException- in the following cases:forceis false and the name of the user who tries to unlock a path does not match the lock owner- a lock token is incorrect for a path
- a failure occurred while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
unlock12
private void unlock12(java.util.Map pathToTokens, boolean force, ISVNLockHandler handler) throws SVNException - Throws:
SVNException
-
info
Description copied from class:SVNRepositoryGives information about an entry located at the specified path in a particular revision.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").- Specified by:
infoin classSVNRepository- Parameters:
path- an item's pathrevision- a revision of the entry; defaults to the latest revision (HEAD)- Returns:
- an SVNDirEntry containing information about
the entry or null if
there's no entry with at the specified
pathunder the specifiedrevision - Throws:
SVNException- in the following cases:- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
-
updateCredentials
- Throws:
SVNException
-
openConnection
- Throws:
SVNException
-
closeConnection
protected void closeConnection() -
getRealm
public java.lang.String getRealm() -
authenticate
- Throws:
SVNException
-
write
- Throws:
SVNException
-
read
private java.util.List read(java.lang.String template, java.util.List values, boolean readMalformedData) throws SVNException - Throws:
SVNException
-
readItem
- Throws:
SVNException
-
readTuple
private java.util.List readTuple(java.lang.String template, boolean readMalformedData) throws SVNException - Throws:
SVNException
-
setPath
public void setPath(java.lang.String path, java.lang.String lockToken, long revision, boolean startEmpty) throws SVNException Description copied from interface:ISVNReporterDescribes a local path as being at a particular revision.
If
startEmptyis true and thepathis a directory, an implementor should assume the directory has no entries or properties (used in checkouts and aborted updates).A next call to this method will "override" any previous
setPath()calls made on parent paths. Thepathis relative to the repository location specified for an SVNRepository driver.- Specified by:
setPathin interfaceISVNReporter- Parameters:
path- a local item's pathlockToken- if not null, it is a lock token for thepathrevision- the local item's revision numberstartEmpty- if true and if thepathis a directory, then means there're no entries yet- Throws:
SVNException- in case the repository could not be connected
-
deletePath
Description copied from interface:ISVNReporterDescribes a working copypathas deleted or missing.- Specified by:
deletePathin interfaceISVNReporter- Parameters:
path- a path relative to the root of the report- Throws:
SVNException- in case the repository could not be connected
-
linkPath
public void linkPath(SVNURL url, java.lang.String path, java.lang.String lockToken, long revision, boolean startEmpty) throws SVNException Description copied from interface:ISVNReporterDescribes a local path as being at a particular revision to switch the path to a different repository location. LikesetPath(), but differs in that the local item'spath(relative to the root of the report driver) isn't a reflection of the path in the repository, but is instead a reflection of a different repository path at arevision. IfstartEmptyis set and thepathis a directory, the implementor should assume the directory has no entries or properties.- Specified by:
linkPathin interfaceISVNReporter- Parameters:
url- a new repository location to switch topath- the local item's pathlockToken- if not null, it is a lock token for thepathrevision- the local item's revision numberstartEmpty- if true and if thepathis a directory, then means there're no entries yet- Throws:
SVNException- in case the repository could not be connected
-
finishReport
Description copied from interface:ISVNReporterFinalizes the report. Must be called when having traversed a local tree of paths.Any directories or files not explicitly set (described) are assumed to be at the baseline revision.
- Specified by:
finishReportin interfaceISVNReporter- Throws:
SVNException- in case the repository could not be connected
-
abortReport
Description copied from interface:ISVNReporterAborts the current running report due to errors occured.If an error occurs during a report, call this method to abort the reporter correctly.
- Specified by:
abortReportin interfaceISVNReporter- Throws:
SVNException- in case the repository could not be connected
-
getRepositoryPaths
- Throws:
SVNException
-
setExternalUserName
public void setExternalUserName(java.lang.String userName) -
getExternalUserName
public java.lang.String getExternalUserName() -
closeSession
public void closeSession()Description copied from class:SVNRepositoryCloses the current session closing a socket connection used by this object. If this driver object keeps a single connection for all the data i/o, this method helps to reset the connection.- Specified by:
closeSessionin classSVNRepository
-
handleUnsupportedCommand
- Throws:
SVNException
-
linkPath
public void linkPath(SVNURL url, java.lang.String path, java.lang.String lockToken, long revision, SVNDepth depth, boolean startEmpty) throws SVNException Description copied from interface:ISVNReporterDescribes a local path as being at a particular revision to switch the path to a different repository location. LikeISVNReporter.setPath(String, String, long, SVNDepth, boolean), but differs in that the local item'spath(relative to the root of the report driver) isn't a reflection of the path in the repository, but is instead a reflection of a different repositoryurlatrevision, and has depthdepth.pathmay not be underneath a path on whichISVNReporter.setPath(String, String, long, SVNDepth, boolean)was previously called withSVNDepth.EXCLUDEin this report. IfstartEmptyis set andpathis a directory, that will mean that the directory has no entries or props. IflockTokenis non-null, it is the lock token forpathin the local tree.- Specified by:
linkPathin interfaceISVNReporter- Parameters:
url- a new repository location to switch topath- the local item's pathlockToken- if not null, it is a lock token for thepathrevision- the local item's revision numberdepth- depth ofpathstartEmpty- if true and if thepathis a directory, then means there're no entries yet- Throws:
SVNException- in case the repository could not be connected
-
setPath
public void setPath(java.lang.String path, java.lang.String lockToken, long revision, SVNDepth depth, boolean startEmpty) throws SVNException Description copied from interface:ISVNReporterDescribes a working copypathas being at a particularrevisionand having depthdepth.revisionmay be invalid (<0) if (for example)pathrepresents a locally-added path with no revision number, ordepthisSVNDepth.EXCLUDE.pathmay not be underneath a path on whichsetPath()was previously called withSVNDepth.EXCLUDEin this report. IfstartEmptyis set andpathis a directory, this will mean that the directory has no entries or properties. This will *override* any previoussetPath()calls made on parent paths.pathis relative to thelocationof the repository access object. IflockTokenis non-null, it is the lock token forpathin the local tree.- Specified by:
setPathin interfaceISVNReporter- Parameters:
path- a local item's pathlockToken- if not null, it is a lock token for thepathrevision- the local item's revision numberdepth- depth ofpathstartEmpty- if true and if thepathis a directory, then means there're no entries yet- Throws:
SVNException- in case the repository could not be connected
-
diff
public void diff(SVNURL url, long targetRevision, long revision, java.lang.String target, boolean ignoreAncestry, SVNDepth depth, boolean getContents, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Description copied from class:SVNRepositoryAsks this repository access object to 'diff' a working copy againsttargetRevision. Note: this method cannot be used to diff a single file, only a directory. See theSVNRepository.update(SVNURL, long, String, SVNDepth, ISVNReporterBaton, ISVNEditor)method for more details. The client initially provides aneditor; this editor contains knowledge of where the common diff root is in the working copy (whenISVNEditor.openRoot(long)is called). In return, the client receives aISVNReporterobject in hisISVNReporterBatonimplementation. The client then describes its working copy by making calls into the reporter object. When finished, the client callsISVNReporter.finishReport(). ThisSVNRepositoryobject then does a complete drive ofeditor, ending withISVNEditor.closeEdit(), to transmit the diff.targetis an optional single path component that will restrict the scope of things affected by the switch to an entry in the directory represented by thelocationof this object, or null if the entire directory is meant to be switched. The working copy will be diffed againsturlas it exists in revisiontargeRevision, or as it is in HEAD iftargetRevisionis invalid (<0). UseignoreAncestryto control whether or not items being diffed will be checked for relatedness first. Unrelated items are typically transmitted to the editor as a deletion of one thing and the addition of another, but if this flag is true, unrelated items will be diffed as if they were related. Diffs only as deeply asdepthindicates. The caller may not perform any repository access operations using thisSVNRepositoryobject before finishing the report, and may not perform any repository access operations using thisSVNRepositoryobject from within the editing operations ofeditor.getContentsinstructs the driver of theeditorto enable the generation of text deltas. IfgetContentsis false theeditor'sISVNDeltaConsumer.textDeltaChunk(String, SVNDiffWindow)method will be called once withSVNDiffWindow.EMPTY. Note: the reporter provided by this function does NOT supply copy-from information to the diff editor callbacks. Note: in order to prevent pre-1.5 servers from doing more work than needed, and sending too much data back, a pre-1.5 'recurse' directive may be sent to the server, based ondepth.- Specified by:
diffin classSVNRepository- Parameters:
url- a repository location of the entry against which differences are calculatedtargetRevision- a revision number of the entry located at the specifiedurl; defaults to the latest revision (HEAD) if this arg is invalidrevision- a revision number of the repository location to which this driver object is settarget- a target entry name (optional)ignoreAncestry- if true then the ancestry of the two entries to be diffed is ignored, otherwise notdepth- tree depth to processgetContents- if false contents (diff windows) will not be sent to the editorreporter- a caller's reportereditor- a caller's editor- Throws:
SVNException- in the following cases:urlnot found neither in the specifiedrevisionnor in the HEAD revision- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
-
status
public void status(long revision, java.lang.String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Description copied from class:SVNRepositoryGets status of a path to the particulardepthas a scope.SVNRepository.status(long, String, boolean, ISVNReporterBaton, ISVNEditor)- Specified by:
statusin classSVNRepository- Parameters:
revision- a desired revision to get status against; defaults to the latest revision (HEAD)target- an entry name (optional)depth- defines the status scopereporter- a client's reporter-batoneditor- a client's status editor- Throws:
SVNException- in the following cases:- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
update
public void update(SVNURL url, long revision, java.lang.String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Description copied from class:SVNRepositoryAsks this repository access object to 'switch' a versioned tree to a newurl. The client initially provides aneditor; this editor contains knowledge of where the change will begin in the working copy (ISVNEditor.openRoot(long)is called). In return, the client receives aISVNReporterobject in hisISVNReporterBatonimplementation. The client then describes its working copy by making calls into the reporter object. When finished, the client callsISVNReporter.finishReport(). ThisSVNRepositoryobject then does a complete drive ofeditor, ending withISVNEditor.closeEdit(), to switch the working copy.targetis an optional single path component that will restrict the scope of things affected by the switch to an entry in the directory represented by thelocationof this object, or null if the entire directory is meant to be switched. Switches the target only as deeply asdepthindicates. The local tree will be switched torevision, or the HEAD revision if this arg is invalid. The caller may not perform any repository access operations using thisSVNRepositoryobject before finishing the report, and may not perform any repository access operations using thisSVNRepositoryobject from within the editing operations ofeditor. Note: the reporter provided by this function does NOT supply copy-from information to the diff editor callbacks. Note: in order to prevent pre-1.5 servers from doing more work than needed, and sending too much data back, a pre-1.5 'recurse' directive may be sent to the server, based ondepth.- Specified by:
updatein classSVNRepository- Parameters:
url- a new location in the repository to switch torevision- a desired revision to make update to; defaults to the latest revision (HEAD)target- an entry name (optional)depth- the depth for update operationreporter- a caller's reportereditor- a caller's editor- Throws:
SVNException- See Also:
-
update
public void update(long revision, java.lang.String target, SVNDepth depth, boolean sendCopyFromArgs, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Description copied from class:SVNRepositoryUpdates a path receiving changes from a repository.targetis the name (one-level path component) of an entry that will restrict the scope of the update to this entry. In other wordstargetis a child entry of the directory represented by the repository location to which this object is set. For example, if we have something like"/dirA/dirB"in a repository, then this object's repository location may be set to"svn://host:port/path/to/repos/dirA", andtargetmay be"dirB".If
targetis null or empty ("") then the scope of the update operation is the repository location to which this object is set.The
reporteris used to describe the state of the local item(s) (i.e. items' revision numbers, deleted, switched items). All the paths described by thereportershould be relative to the repository location to which this object is set.After that the
editoris used to carry out all the work on updating. Thiseditorcontains knowledge of where the change will begin (whenISVNEditor.openRoot()is called).NOTE: you may not invoke methods of this SVNRepository object from within the provided
reporterandeditor.- Specified by:
updatein classSVNRepository- Parameters:
revision- a desired revision to make update to; defaults to the latest revision (HEAD)target- an entry name (optional)depth- a depth for update operation, determines the scope of the updatereporter- a caller's reportereditor- a caller's editor- Throws:
SVNException- in case the repository could not be connectedSVNAuthenticationException- in case of authentication problems- See Also:
-
getMergeInfoImpl
protected java.util.Map getMergeInfoImpl(java.lang.String[] paths, long revision, SVNMergeInfoInheritance inherit, boolean includeDescendants) throws SVNException - Specified by:
getMergeInfoImplin classSVNRepository- Throws:
SVNException
-
hasCapability
Description copied from class:SVNRepositoryReturnstrueif the repository has specifiedcapability. This method may need to establish connection with the repository if information on capabilities has not been received yet from the repository.- Specified by:
hasCapabilityin classSVNRepository- Parameters:
capability- one ofSVNCapability- Returns:
- boolean if the repository has specified capability
- Throws:
SVNException- in case the repository could not be connectedSVNAuthenticationException- in case of authentication problems- See Also:
-
getCommitEditorInternal
protected ISVNEditor getCommitEditorInternal(java.util.Map locks, boolean keepLocks, SVNProperties revProps, ISVNWorkspaceMediator mediator) throws SVNException - Specified by:
getCommitEditorInternalin classSVNRepository- Throws:
SVNException
-
replayRangeImpl
protected void replayRangeImpl(long startRevision, long endRevision, long lowRevision, boolean sendDeltas, ISVNReplayHandler handler) throws SVNException - Specified by:
replayRangeImplin classSVNRepository- Throws:
SVNException
-
getDeletedRevisionImpl
protected long getDeletedRevisionImpl(java.lang.String path, long pegRevision, long endRevision) throws SVNException - Specified by:
getDeletedRevisionImplin classSVNRepository- Throws:
SVNException
-
getRecurseFromDepth
-
ensureAbsolutePath
private static java.lang.String ensureAbsolutePath(java.lang.String path) -
getDepthFilterEditor
-
getInheritedPropertiesImpl
protected void getInheritedPropertiesImpl(java.lang.String path, long revision, java.lang.String propertyName, ISVNInheritedPropertiesHandler handler) throws SVNException - Specified by:
getInheritedPropertiesImplin classSVNRepository- Throws:
SVNException
-