Class SVNRepository
In particular this low-level protocol driver is used by the high-level API (represented by the org.tmatesoft.svn.core.wc package) when an access to a repository is needed.
It is important to say that before using the library it must be configured
according to implimentations to be used. That is if a repository is assumed
to be accessed either via the WebDAV protocol (http:// or
https://), or a custom svn one (svn:// or svn+ssh://)
or immediately on the local machine (file:///) a user must initialize the library
in a proper way:
//import neccessary classes import org.tmatesoft.svn.core.internal.io.fs.FSRepositoryFactory; import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory; import org.tmatesoft.svn.core.internal.io.svn.SVNRepositoryFactoryImpl; import org.tmatesoft.svn.core.SVNURL; import org.tmatesoft.svn.core.io.SVNRepository; import org.tmatesoft.svn.core.io.SVNRepositoryFactory; import import org.tmatesoft.svn.core.wc.SVNWCUtil; import import org.tmatesoft.svn.core.SVNException; ... //Set up connection protocols support: //http:// and https:// DAVRepositoryFactory.setup(); //svn://, svn+xxx:// (svn+ssh:// in particular) SVNRepositoryFactoryImpl.setup(); //file:/// FSRepositoryFactory.setup();
svn+xxx:// can be any tunnel scheme for tunneled working with a
repository. xxx URL scheme is looked up in the section tunnels of the
standard Subversion config file.
So, only after these setup steps the client can create http | svn | file protocol
implementations of the SVNRepository abstract class to access
the repository.
This is a general way how a user creates an SVNRepository driver object:
String url="http://svn.collab.net/svn/trunk"; String name="my name"; String password="my password"; repository = null; try { repository = SVNRepositoryFactory.create(SVNURL.parseURIDecoded(url)); ISVNAuthenticationManager authManager = SVNWCUtil.createDefaultAuthenticationManager(name, password); repository.setAuthenticationManager(authManager); ... } catch (SVNException e){ e.printStackTrace(); System.exit(1); } //work with the repository ...
SVNRepository objects are not thread-safe, we're strongly recommend you not to use one SVNRepository object from within multiple threads.
Also methods of SVNRepository objects are not reenterable - that is,
you can not call operation methods of an SVNRepository driver neither
from within those handlers that are passed to some of the driver's methods, nor
during committing with the help of a commit editor (until the editor's closeEdit()
method is called).
To authenticate a user over network SVNRepository drivers use ISVNAuthenticationManager auth drivers.
- Since:
- 1.2
- Version:
- 1.3
- Author:
- TMate Software Ltd.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnectionListener(ISVNConnectionListener listener) Adds a connection listener to this object.voidassertServerIsMergeInfoCapable(String pathOrURL) Checks that this object is connected to a mergeinfo capable repository.protected static voidassertValidRevision(long revision) voidcheckout(long revision, String target, boolean recursive, ISVNEditor editor) Checks out a directory from a repository.voidcheckout(long revision, String target, SVNDepth depth, ISVNEditor editor) Checks out a directory from a repository to definedepth.voidcheckoutFiles(long revision, String[] paths, ISVNFileCheckoutTarget fileCheckoutHandler) Recursively checks out only files from the repository atrevisioninvokingfileCheckoutHandleron every file received.abstract SVNNodeKindReturns the kind of an item located at the specified path in a particular revision.abstract voidCloses the current session closing a socket connection used by this object.voiddiff(SVNURL url, long targetRevision, long revision, String target, boolean ignoreAncestry, boolean recursive, boolean getContents, ISVNReporterBaton reporter, ISVNEditor editor) Deprecated.voiddiff(SVNURL url, long targetRevision, long revision, String target, boolean ignoreAncestry, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) Deprecated.abstract voiddiff(SVNURL url, long targetRevision, long revision, String target, boolean ignoreAncestry, SVNDepth depth, boolean getContents, ISVNReporterBaton reporter, ISVNEditor editor) Asks this repository access object to 'diff' a working copy againsttargetRevision.voiddiff(SVNURL url, long revision, String target, boolean ignoreAncestry, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) Deprecated.protected voidprotected voidReturns the authentication driver registered for this object.Returns the canceller, stored in this object.abstract ISVNEditorgetCommitEditor(String logMessage, Map locks, boolean keepLocks, ISVNWorkspaceMediator mediator) Gets an editor for committing changes to a repository.getCommitEditor(String logMessage, Map locks, boolean keepLocks, SVNProperties revisionProperties, ISVNWorkspaceMediator mediator) Returns an editor for committing changes to the repository ession, setting the revision properties fromrevisionPropertiestable.getCommitEditor(String logMessage, ISVNWorkspaceMediator mediator) Gets an editor for committing changes to a repository.protected abstract ISVNEditorgetCommitEditorInternal(Map locks, boolean keepLocks, SVNProperties revProps, ISVNWorkspaceMediator mediator) abstract longgetDatedRevision(Date date) Returns the recent repository revision number for the particular moment in time - the closest one before or at the specified datestamp.org.tmatesoft.svn.util.ISVNDebugLogReturns the debug logger currently in use.longgetDeletedRevision(String path, long pegRevision, long endRevision) Returns the revision where the path was first deleted within the inclusive revision range defined bypegRevisionandendRevision.protected abstract longgetDeletedRevisionImpl(String path, long pegRevision, long endRevision) abstract SVNDirEntrygetDir(String path, long revision, boolean includeCommitMessages, Collection entries) Fetches the contents of a directory into the provided collection object and returns the directory entry itself.getDir(String path, long revision, SVNProperties properties, int entryFields, Collection dirEntries) Fetches the contents and properties of a directory located at the specified path in a particular revision with the possibility to specify fields of the entry to fetch.abstract longgetDir(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.getDir(String path, long revision, SVNProperties properties, Collection dirEntries) Fetches the contents and properties of a directory located at the specified path in a particular revision.abstract longgetDir(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.Returns the event handler, stored in this object.abstract longgetFile(String path, long revision, SVNProperties properties, OutputStream contents) Fetches the contents and/or properties of a file located at the specified path in a particular revision.intgetFileRevisions(String path, long startRevision, long endRevision, boolean includeMergedRevisions, ISVNFileRevisionHandler handler) Retrieves interesting file revisions for the specified file with possibility to include merged revisions.intgetFileRevisions(String path, long startRevision, long endRevision, ISVNFileRevisionHandler handler) Retrieves interesting file revisions for the specified file.getFileRevisions(String path, Collection revisions, long sRevision, long eRevision) Retrieves and returns interesting file revisions for the specified file.protected abstract intgetFileRevisionsImpl(String path, long startRevision, long endRevision, boolean includeMergedRevisions, ISVNFileRevisionHandler handler) getFullPath(String relativeOrRepositoryPath) Resolves a path, relative either to the location to which this driver object is set or to the repository root directory, to a path, relative to the host.getInheritedProperties(String path, long revision, String propertyName) voidgetInheritedProperties(String path, long revision, String propertyName, ISVNInheritedPropertiesHandler handler) protected abstract voidgetInheritedPropertiesImpl(String path, long revision, String propertyName, ISVNInheritedPropertiesHandler handler) abstract longReturns the number of the latest revision of the repository this driver is working with.Returns the repository location to which this object is set.protected StringgetLocationRelativePath(String relativeOrAbsolutePath) intgetLocations(String path, long pegRevision, long[] revisions, ISVNLocationEntryHandler handler) Gets entry locations in time.getLocations(String path, Collection entries, long pegRevision, long[] revisions) Gets entry locations in time.getLocations(String path, Map entries, long pegRevision, long[] revisions) Gets entry locations in time.getLocationSegments(String path, long pegRevision, long startRevision, long endRevision) Callshandlerfor each segment in the location history ofpathinpegRevision, working backwards in time fromstartRevisiontoendRevision.longgetLocationSegments(String path, long pegRevision, long startRevision, long endRevision, ISVNLocationSegmentHandler handler) Callshandlerfor each segment in the location history ofpathinpegRevision, working backwards in time fromstartRevisiontoendRevision.protected abstract longgetLocationSegmentsImpl(String path, long pegRevision, long startRevision, long endRevision, ISVNLocationSegmentHandler handler) protected abstract intgetLocationsImpl(String path, long pegRevision, long[] revisions, ISVNLocationEntryHandler handler) abstract SVNLockGets the lock for the file located at the specified path.abstract SVNLock[]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.getMergeInfo(String[] paths, long revision, SVNMergeInfoInheritance inherit, boolean includeDescendants) Returns merge information for the repository entries inpathsfor paricularrevision, if the repository supports merge-tracking informationprotected abstract MapgetMergeInfoImpl(String[] paths, long revision, SVNMergeInfoInheritance inherit, boolean includeDescendants) Returns the session options object this driver is using.getRepositoryPath(String relativePath) Returns a path relative to the repository root directory given a path relative to the location to which this driver object is set.Deprecated.use #getRepositoryRoot(boolean) insteadgetRepositoryRoot(boolean forceConnection) Gets a repository's root directory location.Deprecated.usegetRepositoryUUID(boolean)insteadgetRepositoryUUID(boolean forceConnection) Gets the Universal Unique IDentifier (UUID) of the repository this driver is created for.protected static LonggetRevisionObject(long revision) abstract SVNPropertiesgetRevisionProperties(long revision, SVNProperties properties) Returns unversioned revision properties for a particular revision.abstract SVNPropertyValuegetRevisionPropertyValue(long revision, String propertyName) Gets the value of an unversioned property.Returns a tunnel provider.abstract booleanhasCapability(SVNCapability capability) Returnstrueif the repository has specifiedcapability.abstract SVNDirEntryGives information about an entry located at the specified path in a particular revision.protected static booleanisInvalidRevision(long revision) protected static booleanisValidRevision(long revision) protected voidlock()protected voidlock(boolean force) abstract voidlock(Map pathsToRevisions, String comment, boolean force, ISVNLockHandler handler) Locks path(s) at definite revision(s).longlog(String[] targetPaths, long startRevision, long endRevision, boolean discoverChangedPaths, boolean strictNodeHistory, long limit, boolean includeMergedRevisions, String[] revisionProperties, ISVNLogEntryHandler handler) Invokeshandleron each log message fromstartRevisiontoendRevision.longlog(String[] targetPaths, long startRevision, long endRevision, boolean changedPath, boolean strictNode, long limit, ISVNLogEntryHandler handler) Traverses revisions history.longlog(String[] targetPaths, long startRevision, long endRevision, boolean changedPath, boolean strictNode, ISVNLogEntryHandler handler) Traverses revisions history.log(String[] targetPaths, Collection entries, long startRevision, long endRevision, boolean changedPath, boolean strictNode) Traverses revisions history and returns a collection of log entries.protected abstract longlogImpl(String[] targetPaths, long startRevision, long endRevision, boolean changedPath, boolean strictNode, long limit, boolean includeMergedRevisions, String[] revisionProperties, ISVNLogEntryHandler handler) voidRemoves the specified connection listener from the collection of connection listeners held by this object.abstract voidreplay(long lowRevision, long revision, boolean sendDeltas, ISVNEditor editor) Replays the changes from the specified revision through the given editor.voidreplayRange(long startRevision, long endRevision, long lowRevision, boolean sendDeltas, ISVNReplayHandler handler) Replays the changes from a range of revisions betweenstartRevisionandendRevision.protected abstract voidreplayRangeImpl(long startRevision, long endRevision, long lowRevision, boolean sendDeltas, ISVNReplayHandler handler) voidsetAuthenticationManager(ISVNAuthenticationManager authManager) Sets an authentication driver for this object.voidsetCanceller(ISVNCanceller canceller) Sets a canceller to this object.voidsetDebugLog(org.tmatesoft.svn.util.ISVNDebugLog log) Sets a logger to write debug log information to.voidsetEventHandler(ISVNEventHandler myEventHandler) Sets a event handler to this object.voidsetLocation(SVNURL url, boolean forceReconnect) Sets a new repository location for this object.protected voidsetLocationInternal(SVNURL url, boolean forceReconnect) protected voidsetRepositoryCredentials(String uuid, SVNURL rootURL) Caches identification parameters (UUID, rood directory location) of the repository with which this driver is working.abstract voidsetRevisionPropertyValue(long revision, String propertyName, SVNPropertyValue propertyValue) Sets a revision property with the specified name to a new value.voidsetTunnelProvider(ISVNTunnelProvider tunnelProvider) Sets a tunnel provider.voidstatus(long revision, String target, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) Gets status of a path.abstract voidstatus(long revision, String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) Gets status of a path to the particulardepthas a scope.abstract voidTries to access a repository.protected voidunlock()abstract voidunlock(Map pathToTokens, boolean force, ISVNLockHandler handler) Removes lock(s) from the file(s).voidupdate(long revision, String target, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) Updates a path receiving changes from a repository.abstract voidupdate(long revision, String target, SVNDepth depth, boolean sendCopyFromArgs, ISVNReporterBaton reporter, ISVNEditor editor) Updates a path receiving changes from a repository.voidupdate(SVNURL url, long revision, String target, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) Deprecated.abstract voidupdate(SVNURL url, long revision, String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) Asks this repository access object to 'switch' a versioned tree to a newurl.
-
Field Details
-
INVALID_REVISION
public static final long INVALID_REVISIONIs used as an initialization value in cases, when revision is not defined, often represents HEAD revision- See Also:
-
myRepositoryUUID
-
myRepositoryRoot
-
myLocation
-
myOriginalLocations
-
-
Constructor Details
-
SVNRepository
-
-
Method Details
-
getLocation
Returns the repository location to which this object is set. It may be the location that was used to create this object (seeSVNRepositoryFactory.create(SVNURL)), or the recent one the object was set to.- Returns:
- a repository location set for this driver
- See Also:
-
setLocation
Sets 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 callingcloseSession()).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.- 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
-
setLocationInternal
- Throws:
SVNException
-
getRepositoryUUID
Deprecated.usegetRepositoryUUID(boolean)instead- Returns:
- the UUID of a repository
-
getRepositoryUUID
Gets the Universal Unique IDentifier (UUID) of the repository this driver is created for.- Parameters:
forceConnection- if true then forces this driver to test a connection - try to access a repository- Returns:
- the UUID of a repository
- Throws:
SVNException- in case the repository could not be connectedSVNAuthenticationException- in case of authentication problems
-
getRepositoryRoot
Deprecated.use #getRepositoryRoot(boolean) instead- Returns:
- the repository root directory location url
- See Also:
-
getRepositoryRoot
Gets a repository's root directory location. If this driver object is switched to a different repository location during runtime (probably to an absolutely different repository, seesetLocation()), the root directory location may be changed. This method may need to establish connection with the repository if the information on the repository's root location has not been received yet from the repository.- Parameters:
forceConnection- if true then forces this driver to test a connection - try to access a repository- Returns:
- the repository root directory location url
- Throws:
SVNException- in case the repository could not be connectedSVNAuthenticationException- in case of authentication problems- See Also:
-
setAuthenticationManager
Sets an authentication driver for this object. The auth driver may be implemented to retrieve cached credentials, to prompt a user for credentials or something else (actually, this is up to an implementor). Also there's a default implementation - see theSVNWCUtilclass for more details.- Parameters:
authManager- an authentication driver to provide user credentials- See Also:
-
getAuthenticationManager
Returns the authentication driver registered for this object.- Returns:
- an authentication driver that is used by this object to authenticate a user over network
-
setTunnelProvider
Sets a tunnel provider. Actually relevant only tosvn+xxx://scheme cases. The provider is responsible for matchingxxxto the tunnel command string.If one would like to have a standard Subversion behaviour (when tunnel commands are fetched from the
configfile beneath the section namedtunnels), he should provide a default provider (default implementation of theISVNOptionsinterface). Refer toSVNWCUtilclass for more details on how to get a default options driver.- Parameters:
tunnelProvider- a tunnel provider- See Also:
-
getTunnelProvider
Returns a tunnel provider.- Returns:
- a tunnel provider
- See Also:
-
setCanceller
Sets a canceller to this object.- Parameters:
canceller- canceller object- Since:
- 1.2.0
-
getCanceller
Returns the canceller, stored in this object.- Returns:
- canceller object
- Since:
- 1.2.0
-
setEventHandler
Sets a event handler to this object.- Since:
- 1.8.14
-
getEventHandler
Returns the event handler, stored in this object.- Since:
- 1.8.14
-
setRepositoryCredentials
Caches identification parameters (UUID, rood directory location) of the repository with which this driver is working.- Parameters:
uuid- the repository's Universal Unique IDentifier (UUID)rootURL- the repository's root directory location- See Also:
-
testConnection
Tries 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.- Throws:
SVNException- if a failure occured while connecting to a repository or the user's authentication failed (seeSVNAuthenticationException)
-
getLatestRevision
Returns the number of the latest revision of the repository this driver is working with.- Returns:
- the latest revision number
- Throws:
SVNException- if a failure occured while connecting to a repository or the user's authentication failed (seeSVNAuthenticationException)
-
getDatedRevision
Returns 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.
- 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 abstract SVNProperties getRevisionProperties(long revision, SVNProperties properties) throws SVNException Returns 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.- 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:
-
setRevisionPropertyValue
public abstract void setRevisionPropertyValue(long revision, String propertyName, SVNPropertyValue propertyValue) throws SVNException Sets 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.
- 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:
-
getRevisionPropertyValue
public abstract SVNPropertyValue getRevisionPropertyValue(long revision, String propertyName) throws SVNException Gets the value of an unversioned property.- 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
Returns 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"/").- 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)
-
getFile
public abstract long getFile(String path, long revision, SVNProperties properties, OutputStream contents) throws SVNException Fetches 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.- 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 abstract long getDir(String path, long revision, SVNProperties properties, ISVNDirEntryHandler handler) throws SVNException Fetches the contents and/or properties of a directory located at the specified path in a particular revision.This method is the same as
getDir(String, long, SVNProperties, int, ISVNDirEntryHandler)withentryFieldsparameter set toDIRENT_ALL.- 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 abstract long getDir(String path, long revision, SVNProperties properties, int entryFields, ISVNDirEntryHandler handler) throws SVNException 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.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.- 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:
-
getFileRevisions
public int getFileRevisions(String path, long startRevision, long endRevision, ISVNFileRevisionHandler handler) throws SVNException Retrieves interesting file revisions for the specified file.A file revision is represented by an SVNFileRevision object. Each file revision is handled by the file revision handler provided. Only those revisions will be retrieved in which the file was changed. The iteration will begin at the first such revision starting from the
startRevisionand so on - up to theendRevision. If the method succeeds, the providedhandlerwill have been invoked at least once.For the first interesting revision the file contents will be provided to the
handleras a text delta against an empty file. For the following revisions, the delta will be against the fulltext contents of the previous revision.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").NOTES:
- you may not invoke methods of this SVNRepository
object from within the provided
handler - this functionality is not available in pre-1.1 servers
- Parameters:
path- a file pathstartRevision- a revision to start fromendRevision- a revision to stop athandler- a handler that processes file revisions passed- Returns:
- the number of retrieved file revisions
- Throws:
SVNException- if a failure occured while connecting to a repository or the user's authentication failed (seeSVNAuthenticationException)- Since:
- SVN 1.1
- See Also:
- you may not invoke methods of this SVNRepository
object from within the provided
-
getFileRevisions
public int getFileRevisions(String path, long startRevision, long endRevision, boolean includeMergedRevisions, ISVNFileRevisionHandler handler) throws SVNException Retrieves interesting file revisions for the specified file with possibility to include merged revisions.A file revision is represented by an SVNFileRevision object. Each file revision is handled by the file revision handler provided. The iteration will begin at the first such revision starting from the
startRevisionand so on - up to theendRevision. IfincludeMergedRevisionsistrue, then revisions which were result of a merge will be included as well. If the method succeeds, the providedhandlerwill have been invoked at least once.For the first interesting revision the file contents will be provided to the
handleras a text delta against an empty file. For the following revisions, the delta will be against the fulltext contents of the previous revision.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").NOTES:
- you may not invoke methods of this SVNRepository
object from within the provided
handler - this functionality is not available in pre-1.1 servers
- Parameters:
path- a file pathstartRevision- a revision to start fromendRevision- a revision to stop atincludeMergedRevisions- if istrue, merged revisions will be returned as wellhandler- a handler that processes file revisions passed- Returns:
- the number of retrieved file revisions
- Throws:
SVNException- if a failure occured while connecting to a repository or the user's authentication failed (seeSVNAuthenticationException)- Since:
- SVNKit 1.2.0, SVN 1.5.0
- See Also:
- you may not invoke methods of this SVNRepository
object from within the provided
-
assertServerIsMergeInfoCapable
Checks that this object is connected to a mergeinfo capable repository. If the repository that this object is used to access to does not support merge-tracking, anSVNExceptionis thrown with the error codeSVNErrorCode.UNSUPPORTED_FEATURE.pathOrURLis used only in an error message. IfpathOrURLis null, it defaults to thelocationof this object.- Parameters:
pathOrURL- path or URl string for an error message- Throws:
SVNException- exception withSVNErrorCode.UNSUPPORTED_FEATUREerror code - if the repository does not support merge-tracking- Since:
- 1.2.0
-
log
public long log(String[] targetPaths, long startRevision, long endRevision, boolean changedPath, boolean strictNode, ISVNLogEntryHandler handler) throws SVNException Traverses revisions history. In other words, collects per revision information that includes the revision number, author, datestamp, log message and maybe a list of changed paths (optional). For each revision this information is represented by an SVNLogEntry object. Such objects are passed to the providedhandler.This method invokes
handleron each log entry fromstartRevisiontoendRevision.startRevisionmay be greater or less thanendRevision; this just controls whether the log messages are processed in descending or ascending revision number order.If
startRevisionorendRevisionis invalid, it defaults to the youngest.If
targetPathshas one or more elements, then only those revisions are processed in which at least one oftargetPathswas changed (i.e., if a file text or properties changed; if dir properties changed or an entry was added or deleted). Each path is relative to the repository location that this object is set to.If
changedPathis true, then each SVNLogEntry passed to the handler will contain info about all paths changed in that revision it represents. To get them callSVNLogEntry.getChangedPaths()that returns a map, which keys are the changed paths and the values are SVNLogEntryPath objects. IfchangedPathis false, changed paths info will not be provided.If
strictNodeis true, copy history will not be traversed (if any exists) when harvesting the revision logs for each path.Target paths can be both relative to the location of this driver and absolute to the repository root (starts with
"/").NOTE: you may not invoke methods of this SVNRepository object from within the provided
handler.- Parameters:
targetPaths- paths that mean only those revisions at which they were changedstartRevision- a revision to start fromendRevision- a revision to end atchangedPath- if true then revision information will also include all changed paths per revision, otherwise notstrictNode- if true then copy history (if any) is not to be traversedhandler- a caller's handler that will be dispatched log entry objects- Returns:
- the number of revisions traversed
- Throws:
SVNException- if a failure occured while connecting to a repository or the user's authentication failed (seeSVNAuthenticationException)- See Also:
-
log
public long log(String[] targetPaths, long startRevision, long endRevision, boolean changedPath, boolean strictNode, long limit, ISVNLogEntryHandler handler) throws SVNException Traverses revisions history. In other words, collects per revision information that includes the revision number, author, datestamp, log message and maybe a list of changed paths (optional). For each revision this information is represented by an SVNLogEntry object. Such objects are passed to the providedhandler.This method invokes
handleron each log entry fromstartRevisiontoendRevision.startRevisionmay be greater or less thanendRevision; this just controls whether the log messages are processed in descending or ascending revision number order.If
startRevisionorendRevisionis invalid, it defaults to the youngest.If
targetPathshas one or more elements, then only those revisions are processed in which at least one oftargetPathswas changed (i.e., if a file text or properties changed; if dir properties changed or an entry was added or deleted). Each path can be either absolute or relative to the repository location that this object is set to.If
changedPathis true, then each SVNLogEntry passed to the handler will contain info about all paths changed in that revision it represents. To get them callSVNLogEntry.getChangedPaths()that returns a map, which keys are the changed paths and the values are SVNLogEntryPath objects. IfchangedPathis false, changed paths info will not be provided.If
strictNodeis true, copy history will not be traversed (if any exists) when harvesting the revision logs for each path.If
limitis > 0 then only the firstlimitlog entries will be handled. Otherwise (i.e. iflimitis 0) this number is ignored.Target paths can be both relative to the location of this driver and absolute to the repository root (starts with
"/").NOTE: you may not invoke methods of this SVNRepository object from within the provided
handler.- Parameters:
targetPaths- paths that mean only those revisions at which they were changedstartRevision- a revision to start fromendRevision- a revision to end atchangedPath- if true then revision information will also include all changed paths per revision, otherwise notstrictNode- if true then copy history (if any) is not to be traversedlimit- the maximum number of log entries to processhandler- a caller's handler that will be dispatched log entry objects- Returns:
- the number of revisions traversed
- Throws:
SVNException- if a failure occured while connecting to a repository or the user's authentication failed (seeSVNAuthenticationException)- See Also:
-
log
public long log(String[] targetPaths, long startRevision, long endRevision, boolean discoverChangedPaths, boolean strictNodeHistory, long limit, boolean includeMergedRevisions, String[] revisionProperties, ISVNLogEntryHandler handler) throws SVNException Invokeshandleron each log message fromstartRevisiontoendRevision.startRevisionmay be greater or less thanendRevision; this just controls whether the log messages are processed in descending or ascending revision number order. IfstartRevisionorendRevisionis invalid (<0), it defaults to youngest. IftargetPathsis non-null and has one or more elements, then shows only revisions in which at least one oftargetPathswas changed (i.e., if file, text or props changed; if dir, props changed or an entry was added or deleted). Each path may be either absolut (starts with '/') or relative to this object'slocation. Iflimitis non-zero only invokeshandleron the firstlimitlogs. IfdiscoverChangedPathsis set, then each call tohandlerpasses anSVNLogEntryobject with non-emptychanged paths map; the hash's keys are all the paths committed in that revision. Otherwise, each call tohandlerpasses null for changed paths. IfstrictNodeHistoryis set, copy history will not be traversed (if any exists) when harvesting the revision logs for each path. IfincludeMergedRevisionsis set, log information for revisions which have been merged totargetPahtswill also be returned. Refer toSVNLogEntry.hasChildren()for additional information on how to handle mergeinfo information during a log operation. IfrevisionPropertiesis null, retrieves all revprops; else, retrieves only the revprops named in the array (i.e. retrieves none if the array is empty). If any invocation ofhandlerthrows an exception, then throws that exception immediately and without wrapping it. Note: the caller may not invoke any repository access operations using from withinhandler. Note: iftargetPahtsis null or empty, the result depends on the server. Pre-1.5 servers will send nothing; 1.5 servers will effectively perform the log operation on the root of the repository. This behavior may be changed in the future to ensure consistency across all pedigrees of server. Note: pre-1.5 servers do not support custom revision properties retrieval; ifrevisionPropertiesis null or contains a revision property other thanSVNRevisionProperty.AUTHOR,SVNRevisionProperty.DATE,SVNRevisionProperty.LOG, an exception with theSVNErrorCode.RA_NOT_IMPLEMENTEDerror code is thrown.- Parameters:
targetPaths- paths that mean only those revisions at which they were changedstartRevision- a revision to start fromendRevision- a revision to end atdiscoverChangedPaths- if true then revision information will also include all changed paths per revision, otherwise notstrictNodeHistory- if true then copy history (if any) is not to be traversedlimit- the maximum number of log entries to processincludeMergedRevisions- whether mergeinfo information should be taken into account or notrevisionProperties- revision properties to fetch with log entrieshandler- a caller's handler that will be dispatched log entry objects- Returns:
- the number of revisions traversed
- Throws:
SVNException- in the following cases:-
exception with
SVNErrorCode.FS_NO_SUCH_REVISIONerror code - ifstartRevisionorendRevisionis a non-existent revision exception withSVNErrorCode.RA_NOT_IMPLEMENTEDerror code - in case of a pre-1.5 server and custom revision properties requested- Since:
- 1.2.0, New in Subversion 1.5.0
-
getLocations
public int getLocations(String path, long pegRevision, long[] revisions, ISVNLocationEntryHandler handler) throws SVNException Gets entry locations in time. The location of an entry in a repository may change from revision to revision. This method allows to trace entry locations in different revisions.For each interesting revision (taken from
revisions) an entry location is represented by an SVNLocationEntry object which is passed to the providedhandler. Each SVNLocationEntry object represents a repository path in a definite revision.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").NOTES:
- you may not invoke methods of this SVNRepository
object from within the provided
handler - this functionality is not available in pre-1.1 servers
- Parameters:
path- an item's pathpegRevision- a revision in whichpathis first looked uprevisions- an array of numbers of interesting revisions in which locations are looked up. Ifpathdoesn't exist in an interesting revision, that revision will be ignored.handler- a location entry handler that will handle all found entry locations- Returns:
- the number of the entry locations found
- Throws:
SVNException- in the following cases:pathnot found in the specifiedpegRevisionpegRevisionis not valid- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- Since:
- SVN 1.1
- See Also:
- you may not invoke methods of this SVNRepository
object from within the provided
-
getLocationSegments
public long getLocationSegments(String path, long pegRevision, long startRevision, long endRevision, ISVNLocationSegmentHandler handler) throws SVNException Callshandlerfor each segment in the location history ofpathinpegRevision, working backwards in time fromstartRevisiontoendRevision.endRevisionmay be invalid (<0) to indicate that you want to trace the history of the object to its origin.startRevisionmay be invalid to indicate "the HEAD revision". Otherwise,startRevisionmust be younger thanendRevision(unlessendRevisionis invalid).pegRevisionmay be invalid to indicate "the HEAD revision", and must evaluate to be at least as young asstartRevision.- Parameters:
path- repository pathpegRevision- revision in whichpathis validstartRevision- revision range startendRevision- revision range endhandler- caller's segment handler implementation- Returns:
- number of revisions covered by all segments found
- Throws:
SVNException- Since:
- 1.2.0, New in Subversion 1.5.0
-
getLocationSegments
public List<SVNLocationSegment> getLocationSegments(String path, long pegRevision, long startRevision, long endRevision) throws SVNException Callshandlerfor each segment in the location history ofpathinpegRevision, working backwards in time fromstartRevisiontoendRevision. The same asgetLocationSegments(String, long, long, long, ISVNLocationSegmentHandler)except for this method returns a list of all the segments fetched forpath. The list will be sorted into an ascenging order (segments with greater start revisions will be placed in the head of the list).- Parameters:
path- repository pathpegRevision- revision in whichpathis validstartRevision- revision range startendRevision- revision range end- Returns:
- number of revisions covered by all segments found
- Throws:
SVNException- Since:
- 1.2.0, New in Subversion 1.5.0
-
getFileRevisions
public Collection getFileRevisions(String path, Collection revisions, long sRevision, long eRevision) throws SVNException Retrieves and returns interesting file revisions for the specified file.A file revision is represented by an SVNFileRevision object. Only those revisions will be retrieved in which the file was changed. The iteration will begin at the first such revision starting from the
startRevisionand so on - up to theendRevision.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").NOTE: this functionality is not available in pre-1.1 servers
- Parameters:
path- a file pathrevisions- if not null this collection will receive all the fetched file revisionssRevision- a revision to start fromeRevision- a revision to stop at- Returns:
- a collection that keeps file revisions -
SVNFileRevisioninstances - Throws:
SVNException- if a failure occured while connecting to a repository or the user's authentication failed (seeSVNAuthenticationException)- Since:
- SVN 1.1
- See Also:
-
getDir
public Collection getDir(String path, long revision, SVNProperties properties, Collection dirEntries) throws SVNException Fetches the contents and properties of a directory located at the specified path in a particular revision. Information of each directory entry is represented by a single SVNDirEntry object.This method is the same as
getDir(String, long, SVNProperties, int, Collection)withentryFieldsparameter set toDIRENT_ALL.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").- Parameters:
path- a directory pathrevision- a revision numberproperties- if not null then all directory properties (including non-tweakable ones) will be put into this map (where keys are property names and mappings are property values)dirEntries- if not null then this collection receives fetched dir entries (SVNDirEntry objects)- Returns:
- a collection containing fetched directory entries (SVNDirEntry objects)
- 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 Collection<SVNDirEntry> getDir(String path, long revision, SVNProperties properties, int entryFields, Collection dirEntries) throws SVNException Fetches the contents and properties of a directory located at the specified path in a particular revision with the possibility to specify fields of the entry to fetch. Information of each directory entry is represented by a single SVNDirEntry object.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").- Parameters:
path- a directory pathrevision- a revision numberproperties- if not null then all directory properties (including non-tweakable ones) will be put into this map (where keys are property names and mappings are property values)entryFields- a combination of fields for the entrydirEntries- if not null then this collection receives fetched dir entries (SVNDirEntry objects)- Returns:
- a collection containing fetched directory entries (SVNDirEntry objects)
- 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 abstract SVNDirEntry getDir(String path, long revision, boolean includeCommitMessages, Collection entries) throws SVNException Fetches 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"/").- Parameters:
path- a directory pathrevision- a revision numberincludeCommitMessages- 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:
-
log
public Collection log(String[] targetPaths, Collection entries, long startRevision, long endRevision, boolean changedPath, boolean strictNode) throws SVNException Traverses revisions history and returns a collection of log entries. In other words, collects per revision information that includes the revision number, author, datestamp, log message and maybe a list of changed paths (optional). For each revision this information is represented by an SVNLogEntry. object.startRevisionmay be greater or less thanendRevision; this just controls whether the log messages are processed in descending or ascending revision number order.If
startRevisionorendRevisionis invalid, it defaults to the youngest.If
targetPathshas one or more elements, then only those revisions are processed in which at least one oftargetPathswas changed (i.e., if a file text or properties changed; if dir properties changed or an entry was added or deleted). Each path is relative to the repository location that this object is set to.If
changedPathis true, then each SVNLogEntry object is supplied with info about all paths changed in that revision it represents. To get them callSVNLogEntry.getChangedPaths()that returns a map, which keys are the changed paths and the mappings are SVNLogEntryPath objects. IfchangedPathis false, changed paths info will not be provided.If
strictNodeis true, copy history will not be traversed (if any exists) when harvesting the revision logs for each path.Target paths can be both relative to the location of this driver and absolute to the repository root (starts with
"/").- Parameters:
targetPaths- paths that mean only those revisions at which they were changedentries- if not null then this collection will receive log entriesstartRevision- a revision to start fromendRevision- a revision to end atchangedPath- if true then revision information will also include all changed paths per revision, otherwise notstrictNode- if true then copy history (if any) is not to be traversed- Returns:
- a collection with log entries
- Throws:
SVNException- if a failure occured while connecting to a repository or the user's authentication failed (seeSVNAuthenticationException)- See Also:
-
getLocations
public Collection getLocations(String path, Collection entries, long pegRevision, long[] revisions) throws SVNException Gets entry locations in time. The location of an entry in a repository may change from revision to revision. This method allows to trace entry locations in different revisions.For each interesting revision (taken from
revisions) an entry location is represented by an SVNLocationEntry object. Each SVNLocationEntry object represents a repository path in a definite revision.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").NOTE: this functionality is not available in pre-1.1 servers
- Parameters:
path- an item's pathentries- if not null then this collection object receives entry locationspegRevision- a revision in whichpathis first looked uprevisions- an array of numbers of interesting revisions in which locations are looked up. Ifpathdoesn't exist in an interesting revision, that revision will be ignored.- Returns:
- a collection with retrieved entry locations
- Throws:
SVNException- in the following cases:pathnot found in the specifiedpegRevisionpegRevisionis not valid- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- Since:
- SVN 1.1
- See Also:
-
getLocations
public Map getLocations(String path, Map entries, long pegRevision, long[] revisions) throws SVNException Gets entry locations in time. The location of an entry in a repository may change from revision to revision. This method allows to trace entry locations in different revisions.For each interesting revision (taken from
revisions) an entry location is represented by an SVNLocationEntry object. Each SVNLocationEntry object represents a repository path in a definite revision.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").NOTE: this functionality is not available in pre-1.1 servers
- Parameters:
path- an item's pathentries- if not null then this map object receives entry locations (which keys are revision numbers as Longs and mappings are entry locations objects)pegRevision- a revision in whichpathis first looked uprevisions- an array of numbers of interesting revisions in which locations are looked up. Ifpathdoesn't exist in an interesting revision, that revision will be ignored.- Returns:
- a map (which keys are revision numbers as Longs and mappings are entry locations objects) with collected entry locations
- Throws:
SVNException- in the following cases:pathnot found in the specifiedpegRevisionpegRevisionis not valid- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- Since:
- SVN 1.1
- See Also:
-
diff
public void diff(SVNURL url, long targetRevision, long revision, String target, boolean ignoreAncestry, boolean recursive, boolean getContents, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Deprecated.Calculates the differences between two items.targetis the name (one-level path component) of an entry that will restrict the scope of the diff operation 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 diff operation is the repository location to which this object is set.The
reporteris used to describe the state of the target item(s) (i.e. items' revision numbers). 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 evaluating differences againsturl. Thiseditorcontains knowledge of where the change will begin (whenISVNEditor.openRoot()is called).If
ignoreAncestryis false then the ancestry of the paths being diffed is taken into consideration - they are treated as related. In this case, for example, if calculating differences between two files with identical contents but different ancestry, the entire contents of the target file is considered as having been removed and added again.If
ignoreAncestryis true then the two paths are merely compared ignoring the ancestry.NOTE: you may not invoke methods of this SVNRepository object from within the provided
This method is analogous toreporterandeditor.diff(url, targetRevision, revision, target, ignoreAncestry, SVNDepth.fromRecurse(recursive), getContents, reporter, editor).- 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 notrecursive- if true and the diff scope is a directory, descends recursively, otherwise notgetContents- if false contents (diff windows) will not be sent to the editor.reporter- 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)
-
diff
public abstract void diff(SVNURL url, long targetRevision, long revision, String target, boolean ignoreAncestry, SVNDepth depth, boolean getContents, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Asks 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 theupdate(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.- 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)
- Since:
- 1.2.0, New in Subversion 1.5.0
-
diff
public void diff(SVNURL url, long targetRevision, long revision, String target, boolean ignoreAncestry, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Deprecated.This method is analogous todiff(SVNURL, long, long, String, boolean, boolean, boolean, ISVNReporterBaton, ISVNEditor).- Parameters:
url-targetRevision-revision-target-ignoreAncestry-recursive-reporter-editor-- Throws:
SVNException
-
diff
public void diff(SVNURL url, long revision, String target, boolean ignoreAncestry, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Deprecated.Calculates the differences between two items.targetis the name (one-level path component) of an entry that will restrict the scope of the diff operation 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 diff operation is the repository location to which this object is set.The
reporteris used to describe the state of the target item(s) (i.e. items' revision numbers). 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 evaluating differences againsturl. Thiseditorcontains knowledge of where the change will begin (whenISVNEditor.openRoot()is called).If
ignoreAncestryis false then the ancestry of the paths being diffed is taken into consideration - they are treated as related. In this case, for example, if calculating differences between two files with identical contents but different ancestry, the entire contents of the target file is considered as having been removed and added again.If
ignoreAncestryis true then the two paths are merely compared ignoring the ancestry.NOTE: you may not invoke methods of this SVNRepository object from within the provided
This method is analogous toreporterandeditor.diff(url, revision, revision, target, ignoreAncestry, SVNDepth.fromRecurse(recursive), true, reporter, editor).- Parameters:
url- a repository location of the entry against which differences are calculatedrevision- 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 notrecursive- if true and the diff scope is a directory, descends recursively, otherwise notreporter- 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)
-
update
public void update(SVNURL url, long revision, String target, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Deprecated.Updates a path switching it to a new repository location.Updates a path as it's described for the
update()method using the providedreporterandeditor, and switching it to a new repository location.NOTE: you may not invoke methods of this SVNRepository object from within the provided
reporterandeditor.- 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)recursive- if true and the switch scope is a directory, descends recursively, otherwise notreporter- a caller's reportereditor- a caller's editor- Throws:
SVNException- in the following cases:- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
-
update
public abstract void update(SVNURL url, long revision, String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Asks 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.- 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- Since:
- 1.2.0, New in Subversion 1.5.0
- See Also:
-
update
public void update(long revision, String target, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Updates 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.- Parameters:
revision- a desired revision to make update to; defaults to the latest revision (HEAD)target- an entry name (optional)recursive- if true and the update scope is a directory, descends recursively, otherwise notreporter- a caller's reportereditor- a caller's 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 abstract void update(long revision, String target, SVNDepth depth, boolean sendCopyFromArgs, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Updates 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.- 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 updatesendCopyFromArgs-reporter- 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:
-
status
public void status(long revision, String target, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Gets status of a path.targetis the name (one-level path component) of an entry that will restrict the scope of the status 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 performing status. 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.- Parameters:
revision- a desired revision to get status against; defaults to the latest revision (HEAD)target- an entry name (optional)recursive- if true and the status scope is a directory, descends recursively, otherwise notreporter- 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:
-
status
public abstract void status(long revision, String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor) throws SVNException Gets status of a path to the particulardepthas a scope.status(long, String, boolean, ISVNReporterBaton, ISVNEditor)- 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:
-
checkout
public void checkout(long revision, String target, boolean recursive, ISVNEditor editor) throws SVNException Checks out a directory from a repository.targetis the name (one-level path component) of an entry that will restrict the scope of the checkout 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 checkout operation is the repository location to which this object is set.The provided
editoris used to carry out all the work on building a local tree of dirs and files being checked out.NOTE: you may not invoke methods of this SVNRepository object from within the provided
editor.- Parameters:
revision- a desired revision of a dir to check out; defaults to the latest revision (HEAD)target- an entry name (optional)recursive- if true and the checkout scope is a directory, descends recursively, otherwise noteditor- a caller's checkout editor- Throws:
SVNException- in the following cases:- the checkout scope is not a directory (only dirs can be checked out)
- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
checkout
public void checkout(long revision, String target, SVNDepth depth, ISVNEditor editor) throws SVNException Checks out a directory from a repository to definedepth.targetis the name (one-level path component) of an entry that will restrict the scope of the checkout 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 checkout operation is the repository location to which this object is set.The provided
editoris used to carry out all the work on building a local tree of dirs and files being checked out.NOTE: you may not invoke methods of this SVNRepository object from within the provided
editor.- Parameters:
revision- a desired revision of a dir to check out; defaults to the latest revision (HEAD)target- an entry name (optional)depth- the checkout operation scopeeditor- a caller's checkout editor- Throws:
SVNException- in the following cases:- the checkout scope is not a directory (only dirs can be checked out)
- a failure occured while connecting to a repository
- the user authentication failed
(see
SVNAuthenticationException)
- See Also:
-
checkoutFiles
public void checkoutFiles(long revision, String[] paths, ISVNFileCheckoutTarget fileCheckoutHandler) throws SVNException Recursively checks out only files from the repository atrevisioninvokingfileCheckoutHandleron every file received. Instead of multiple calls togetFileRevisions(String, long, long, boolean, ISVNFileRevisionHandler)which lead to multiple requests to the repository server a user may use this method to get all interesting files. Ifpathsis not null and not empty, checks out only thosepaths. It means if a path is frompathsand is a file - checks out that file; if a directory - checks out every file under the directory and down the tree. Otherwise ifpathsis null or empty, checks out files from the entire tree under this object'sgetLocation().pathsdoes not have to be sorted; it will be sorted automatically.- Parameters:
revision- revision of files to checkoutpaths- paths to check outfileCheckoutHandler- caller's file data receiver- Throws:
SVNException- Since:
- 1.2.0
-
replay
public abstract void replay(long lowRevision, long revision, boolean sendDeltas, ISVNEditor editor) throws SVNException Replays 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.- Parameters:
lowRevision- a low revision point beyond which a client has no knowledge of paths historyrevision- 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- Since:
- 1.1, new in SVN 1.4
-
replayRange
public void replayRange(long startRevision, long endRevision, long lowRevision, boolean sendDeltas, ISVNReplayHandler handler) throws SVNException Replays the changes from a range of revisions betweenstartRevisionandendRevision. When receiving information for one revision,ISVNReplayHandler.handleStartRevision(long, SVNProperties)is called; this method will provide an editor through which the revision will be replayed. When replaying the revision is finished,ISVNReplayHandler.handleEndRevision(long, SVNProperties, ISVNEditor)will be called so the editor can be closed. Changes will be limited to those that occur under this object'sgetLocation(), and the server will assume that the client has no knowledge of revisions prior tolowRevision. 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. IfsendDeltasis true, the actual text and property changes in the revision will be sent, otherwise dummy text deltas and null property changes will be sent instead. If the server does not support revision range replication, then invokesreplay(long, long, boolean, ISVNEditor)on each revision betweenstartRevisionandendRevisioninclusively.- Parameters:
startRevision- revision range startendRevision- revision range endlowRevision- low water mark revisionsendDeltas- whether to ask the server send text and propertieshandler- caller's handler- Throws:
SVNException- in the following cases:-
exception with
SVNErrorCode.RA_NOT_IMPLEMENTEDerror code - if the server does not support revision range replication- Since:
- 1.2.0, New in Subversion 1.5.0
-
getCommitEditor
public ISVNEditor getCommitEditor(String logMessage, ISVNWorkspaceMediator mediator) throws SVNException Gets 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.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.This method should be rather used with pre-1.2 repositories.
NOTE: you may not invoke methods of this SVNRepository object from within the returned commit editor.
- Parameters:
logMessage- a commit log messagemediator- 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:
-
info
Gives 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"/").- 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)
-
getCommitEditor
public abstract ISVNEditor getCommitEditor(String logMessage, Map locks, boolean keepLocks, ISVNWorkspaceMediator mediator) throws SVNException Gets 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.
- 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:
-
getCommitEditor
public ISVNEditor getCommitEditor(String logMessage, Map locks, boolean keepLocks, SVNProperties revisionProperties, ISVNWorkspaceMediator mediator) throws SVNException Returns an editor for committing changes to the repository ession, setting the revision properties fromrevisionPropertiestable. The revisions being committed against are passed to the editor methods, starting with therevisionargument toISVNEditor.openRoot(long). The path root of the commit is this object'slocation.revisionPropertiesmapsStringproperty names toSVNPropertyValueproperty values.revisionPropertiescan not contain either ofSVNRevisionProperty.LOG,SVNRevisionProperty.DATEorSVNRevisionProperty.AUTHOR.locks, if non-null, is a hash mappingStringpaths (relative to thelocationof this object) toStringlock tokens. The server checks that the correct token is provided for each committed, locked path. IfkeepLocksis true, then does not release locks on committed objects. Else, automatically releasees such locks. The caller may not perform any repository access operations using thisSVNRepositoryobject before finishing the edit.- Parameters:
logMessage- commit log messagelocks- local locks on fileskeepLocks- whether to unlock locked files after the commit or notrevisionProperties- custom revision propertiesmediator- temp delta storage provider; used also to cache wcprops while committing- Returns:
- commit editor
- Throws:
SVNException- in the following cases:-
exception with
SVNErrorCode.CLIENT_PROPERTY_NAMEerror code - ifrevisionPropertiescontains anysvn:namespace property- Since:
- 1.2.0, New in Subversion 1.5.0
-
getCommitEditorInternal
protected abstract ISVNEditor getCommitEditorInternal(Map locks, boolean keepLocks, SVNProperties revProps, ISVNWorkspaceMediator mediator) throws SVNException - Throws:
SVNException
-
getLock
Gets 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"/").- 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)
- Since:
- SVN 1.2
- See Also:
-
getLocks
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.The
patharg can be both relative to the location of this driver and absolute to the repository root (starts with"/").- 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)
- Since:
- SVN 1.2
- See Also:
-
getMergeInfo
public Map<String,SVNMergeInfo> getMergeInfo(String[] paths, long revision, SVNMergeInfoInheritance inherit, boolean includeDescendants) throws SVNException Returns merge information for the repository entries inpathsfor paricularrevision, if the repository supports merge-tracking information- Parameters:
paths- paths under which merge information is to be retrievedrevision- revision for which merge information is to be retrievedinherit- indicates whether explicit, explicit or inherited, or only inherited merge info is retrievedincludeDescendants- indicates whether merge info is retrieved for descendants of elements inpaths- Returns:
- the map of merge information for the repository entries in
paths - Throws:
SVNException- in case the repository could not be connectedSVNAuthenticationException- in case of authentication problems- Since:
- SVNKit 1.2.0, SVN 1.5.0
-
lock
public abstract void lock(Map pathsToRevisions, String comment, boolean force, ISVNLockHandler handler) throws SVNException Locks 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
"/").- 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)
- Since:
- SVN 1.2
- See Also:
-
unlock
public abstract void unlock(Map pathToTokens, boolean force, ISVNLockHandler handler) throws SVNException Removes 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
"/").- 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)
- Since:
- SVN 1.2
- See Also:
-
closeSession
public abstract void closeSession()Closes 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. -
hasCapability
Returnstrueif 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.- 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- Since:
- SVNKit 1.2.0, SVN 1.5.0
- See Also:
-
getOptions
Returns the session options object this driver is using. If no options object was provided to create this driver then it uses a default one -ISVNSession.DEFAULT.- Returns:
- a session options object
-
addConnectionListener
Adds a connection listener to this object. There can be more than one connection listeners added to a singleSVNRepositoryobject. All the provided listeners will be notified each time by this object about a new connection which it's opening. Note: listeners are not notified in case of thefile:///repository access protocol.- Parameters:
listener- caller's connection listener- Since:
- 1.2.0
-
removeConnectionListener
Removes the specified connection listener from the collection of connection listeners held by this object.- Parameters:
listener- connection listener to remove- Since:
- 1.2.0
-
getDeletedRevision
Returns the revision where the path was first deleted within the inclusive revision range defined bypegRevisionandendRevision. Ifpathdoes not exist atpegRevisionor was not deleted within the specified range, then returns an invalid revision (<0).- Parameters:
path- relative or absolute repository pathpegRevision- peg revision to start the search fromendRevision- end revision to end the search at- Returns:
- revision where
pathis first deleted - Throws:
SVNException- ifpegRevisionorendRevisionare invalid or ifpegRevisionis greater thanendRevision, then the exception is setSVNErrorCode.CLIENT_BAD_REVISIONerror code; ifpathis the repository root ("/").- Since:
- 1.3
-
getInheritedProperties
public Map<String,SVNProperties> getInheritedProperties(String path, long revision, String propertyName) throws SVNException - Throws:
SVNException
-
getInheritedProperties
public void getInheritedProperties(String path, long revision, String propertyName, ISVNInheritedPropertiesHandler handler) throws SVNException - Throws:
SVNException
-
getInheritedPropertiesImpl
protected abstract void getInheritedPropertiesImpl(String path, long revision, String propertyName, ISVNInheritedPropertiesHandler handler) throws SVNException - Throws:
SVNException
-
getDeletedRevisionImpl
protected abstract long getDeletedRevisionImpl(String path, long pegRevision, long endRevision) throws SVNException - Throws:
SVNException
-
getLocationSegmentsImpl
protected abstract long getLocationSegmentsImpl(String path, long pegRevision, long startRevision, long endRevision, ISVNLocationSegmentHandler handler) throws SVNException - Throws:
SVNException
-
getLocationsImpl
protected abstract int getLocationsImpl(String path, long pegRevision, long[] revisions, ISVNLocationEntryHandler handler) throws SVNException - Throws:
SVNException
-
logImpl
protected abstract long logImpl(String[] targetPaths, long startRevision, long endRevision, boolean changedPath, boolean strictNode, long limit, boolean includeMergedRevisions, String[] revisionProperties, ISVNLogEntryHandler handler) throws SVNException - Throws:
SVNException
-
getFileRevisionsImpl
protected abstract int getFileRevisionsImpl(String path, long startRevision, long endRevision, boolean includeMergedRevisions, ISVNFileRevisionHandler handler) throws SVNException - Throws:
SVNException
-
getMergeInfoImpl
protected abstract Map getMergeInfoImpl(String[] paths, long revision, SVNMergeInfoInheritance inherit, boolean includeDescendants) throws SVNException - Throws:
SVNException
-
replayRangeImpl
protected abstract void replayRangeImpl(long startRevision, long endRevision, long lowRevision, boolean sendDeltas, ISVNReplayHandler handler) throws SVNException - Throws:
SVNException
-
fireConnectionOpened
protected void fireConnectionOpened() -
fireConnectionClosed
protected void fireConnectionClosed() -
lock
protected void lock() -
lock
protected void lock(boolean force) -
unlock
protected void unlock() -
isInvalidRevision
protected static boolean isInvalidRevision(long revision) -
isValidRevision
protected static boolean isValidRevision(long revision) -
getRevisionObject
-
assertValidRevision
- Throws:
SVNException
-
getRepositoryPath
Returns a path relative to the repository root directory given a path relative to the location to which this driver object is set.- Parameters:
relativePath- a path relative to the location to which this SVNRepository is set- Returns:
- a path relative to the repository root
- Throws:
SVNException- in case the repository could not be connectedSVNAuthenticationException- in case of authentication problems
-
getLocationRelativePath
- Throws:
SVNException
-
getFullPath
Resolves a path, relative either to the location to which this driver object is set or to the repository root directory, to a path, relative to the host.- Parameters:
relativeOrRepositoryPath- a relative path within the repository- Returns:
- a path relative to the host
- Throws:
SVNException- in case the repository could not be connectedSVNAuthenticationException- in case of authentication problems
-
setDebugLog
public void setDebugLog(org.tmatesoft.svn.util.ISVNDebugLog log) Sets a logger to write debug log information to.- Parameters:
log- a debug logger
-
getDebugLog
public org.tmatesoft.svn.util.ISVNDebugLog getDebugLog()Returns the debug logger currently in use.If no debug logger has been specified by the time this call occurs, a default one (returned by
org.tmatesoft.svn.util.SVNDebugLog.getDefaultLog()) will be created and used.- Returns:
- a debug logger
-
diff(SVNURL, long, long, String, boolean, SVNDepth, boolean, ISVNReporterBaton, ISVNEditor)instead