SVNKit Home

org.tmatesoft.svn.core.io
Class SVNRepository

java.lang.Object
  extended byorg.tmatesoft.svn.core.io.SVNRepository

public abstract class SVNRepository
extends Object

The abstract class SVNRepository provides an interface for protocol specific drivers used for direct working with a Subversion repository. SVNRepository joins all low-level API methods needed for repository access operations.

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.

Version:
1.2.0
Author:
TMate Software Ltd.
See Also:
SVNRepositoryFactory, ISVNAuthenticationManager, Examples

Field Summary
static long INVALID_REVISION
          Is used as an initialization value in cases, when revision is not defined, often represents HEAD revision
protected  SVNURL myLocation
           
protected  SVNURL myRepositoryRoot
           
protected  String myRepositoryUUID
           
 
Constructor Summary
protected SVNRepository(SVNURL location, ISVNSession options)
           
 
Method Summary
 void addConnectionListener(ISVNConnectionListener listener)
          Adds a connection listener to this object.
 void assertServerIsMergeInfoCapable(String pathOrURL)
          Checks that this object is connected to a mergeinfo capable repository.
protected static void assertValidRevision(long revision)
           
 void checkout(long revision, String target, boolean recursive, ISVNEditor editor)
          Checks out a directory from a repository.
 void checkout(long revision, String target, SVNDepth depth, ISVNEditor editor)
          Checks out a directory from a repository to define depth.
 void checkoutFiles(long revision, String[] paths, ISVNFileCheckoutTarget fileCheckoutHandler)
          Recursively checks out only files from the repository at revision invoking fileCheckoutHandler on every file received.
abstract  SVNNodeKind checkPath(String path, long revision)
          Returns the kind of an item located at the specified path in a particular revision.
abstract  void closeSession()
          Closes the current session closing a socket connection used by this object.
 void diff(SVNURL url, long targetRevision, long revision, String target, boolean ignoreAncestry, boolean recursive, boolean getContents, ISVNReporterBaton reporter, ISVNEditor editor)
          Deprecated. use diff(SVNURL, long, long, String, boolean, SVNDepth, boolean, ISVNReporterBaton, ISVNEditor) instead
 void diff(SVNURL url, long targetRevision, long revision, String target, boolean ignoreAncestry, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor)
          Deprecated. use diff(SVNURL, long, long, String, boolean, SVNDepth, boolean, ISVNReporterBaton, ISVNEditor) instead
abstract  void diff(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 against targetRevision.
 void diff(SVNURL url, long revision, String target, boolean ignoreAncestry, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor)
          Deprecated. use diff(SVNURL, long, long, String, boolean, SVNDepth, boolean, ISVNReporterBaton, ISVNEditor) instead
protected  void fireConnectionClosed()
           
protected  void fireConnectionOpened()
           
 ISVNAuthenticationManager getAuthenticationManager()
          Returns the authentication driver registered for this object.
 ISVNCanceller getCanceller()
          Returns the canceller, stored in this object.
 ISVNEditor getCommitEditor(String logMessage, ISVNWorkspaceMediator mediator)
          Gets an editor for committing changes to a repository.
abstract  ISVNEditor getCommitEditor(String logMessage, Map locks, boolean keepLocks, ISVNWorkspaceMediator mediator)
          Gets an editor for committing changes to a repository.
 ISVNEditor 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 from revisionProperties table.
protected abstract  ISVNEditor getCommitEditorInternal(Map locks, boolean keepLocks, SVNProperties revProps, ISVNWorkspaceMediator mediator)
           
abstract  long getDatedRevision(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.ISVNDebugLog getDebugLog()
          Returns the debug logger currently in use.
abstract  SVNDirEntry getDir(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.
 Collection 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.
 Collection 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  long getDir(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.
abstract  long getDir(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.
abstract  long getFile(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.
 Collection getFileRevisions(String path, Collection revisions, long sRevision, long eRevision)
          Retrieves and returns interesting file revisions for the specified file.
 int getFileRevisions(String path, long startRevision, long endRevision, boolean includeMergedRevisions, ISVNFileRevisionHandler handler)
          Retrieves interesting file revisions for the specified file with possibility to include merged revisions.
 int getFileRevisions(String path, long startRevision, long endRevision, ISVNFileRevisionHandler handler)
          Retrieves interesting file revisions for the specified file.
protected abstract  int getFileRevisionsImpl(String path, long startRevision, long endRevision, boolean includeMergedRevisions, ISVNFileRevisionHandler handler)
           
 String 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.
abstract  long getLatestRevision()
          Returns the number of the latest revision of the repository this driver is working with.
 SVNURL getLocation()
          Returns the repository location to which this object is set.
 Collection getLocations(String path, Collection entries, long pegRevision, long[] revisions)
          Gets entry locations in time.
 int getLocations(String path, long pegRevision, long[] revisions, ISVNLocationEntryHandler handler)
          Gets entry locations in time.
 Map getLocations(String path, Map entries, long pegRevision, long[] revisions)
          Gets entry locations in time.
 List getLocationSegments(String path, long pegRevision, long startRevision, long endRevision)
          Calls handler for each segment in the location history of path in pegRevision, working backwards in time from startRevision to endRevision.
 long getLocationSegments(String path, long pegRevision, long startRevision, long endRevision, ISVNLocationSegmentHandler handler)
          Calls handler for each segment in the location history of path in pegRevision, working backwards in time from startRevision to endRevision.
protected abstract  long getLocationSegmentsImpl(String path, long pegRevision, long startRevision, long endRevision, ISVNLocationSegmentHandler handler)
           
protected abstract  int getLocationsImpl(String path, long pegRevision, long[] revisions, ISVNLocationEntryHandler handler)
           
abstract  SVNLock getLock(String path)
          Gets the lock for the file located at the specified path.
abstract  SVNLock[] getLocks(String path)
          Gets all locks on or below the path, that is if the repository entry (located at the path) is a directory then the method returns locks of all locked files (if any) in it.
 Map getMergeInfo(String[] paths, long revision, SVNMergeInfoInheritance inherit, boolean includeDescendants)
          Returns merge information for the repository entries in paths for paricular revision, if the repository supports merge-tracking information
protected abstract  Map getMergeInfoImpl(String[] paths, long revision, SVNMergeInfoInheritance inherit, boolean includeDescendants)
           
 ISVNSession getOptions()
          Returns the session options object this driver is using.
 String 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.
 SVNURL getRepositoryRoot()
          Deprecated. use #getRepositoryRoot(boolean) instead
 SVNURL getRepositoryRoot(boolean forceConnection)
          Gets a repository's root directory location.
 String getRepositoryUUID()
          Deprecated. use getRepositoryUUID(boolean) instead
 String getRepositoryUUID(boolean forceConnection)
          Gets the Universal Unique IDentifier (UUID) of the repository this driver is created for.
protected static Long getRevisionObject(long revision)
           
abstract  SVNProperties getRevisionProperties(long revision, SVNProperties properties)
          Returns unversioned revision properties for a particular revision.
abstract  SVNPropertyValue getRevisionPropertyValue(long revision, String propertyName)
          Gets the value of an unversioned property.
 ISVNTunnelProvider getTunnelProvider()
          Returns a tunnel provider.
abstract  boolean hasCapability(SVNCapability capability)
          Returns true if the repository has specified capability.
protected static boolean hasSVNProperties(SVNProperties props)
           
abstract  SVNDirEntry info(String path, long revision)
          Gives information about an entry located at the specified path in a particular revision.
protected static boolean isInvalidRevision(long revision)
           
protected static boolean isValidRevision(long revision)
           
protected  void lock()
           
protected  void lock(boolean force)
           
abstract  void lock(Map pathsToRevisions, String comment, boolean force, ISVNLockHandler handler)
          Locks path(s) at definite revision(s).
 Collection log(String[] targetPaths, Collection entries, long startRevision, long endRevision, boolean changedPath, boolean strictNode)
          Traverses revisions history and returns a collection of log entries.
 long log(String[] targetPaths, long startRevision, long endRevision, boolean changedPath, boolean strictNode, ISVNLogEntryHandler handler)
          Traverses revisions history.
 long log(String[] targetPaths, long startRevision, long endRevision, boolean discoverChangedPaths, boolean strictNodeHistory, long limit, boolean includeMergedRevisions, String[] revisionProperties, ISVNLogEntryHandler handler)
          Invokes handler on each log message from startRevision to endRevision.
 long log(String[] targetPaths, long startRevision, long endRevision, boolean changedPath, boolean strictNode, long limit, ISVNLogEntryHandler handler)
          Traverses revisions history.
protected abstract  long logImpl(String[] targetPaths, long startRevision, long endRevision, boolean changedPath, boolean strictNode, long limit, boolean includeMergedRevisions, String[] revisionProperties, ISVNLogEntryHandler handler)
           
 void removeConnectionListener(ISVNConnectionListener listener)
          Removes the specified connection listener from the collection of connection listeners held by this object.
abstract  void replay(long lowRevision, long revision, boolean sendDeltas, ISVNEditor editor)
          Replays the changes from the specified revision through the given editor.
 void replayRange(long startRevision, long endRevision, long lowRevision, boolean sendDeltas, ISVNReplayHandler handler)
          Replays the changes from a range of revisions between startRevision and endRevision.
protected abstract  void replayRangeImpl(long startRevision, long endRevision, long lowRevision, boolean sendDeltas, ISVNReplayHandler handler)
           
 void setAuthenticationManager(ISVNAuthenticationManager authManager)
          Sets an authentication driver for this object.
 void setCanceller(ISVNCanceller canceller)
          Sets a canceller to this object.
 void setDebugLog(org.tmatesoft.svn.util.ISVNDebugLog log)
          Sets a logger to write debug log information to.
 void setLocation(SVNURL url, boolean forceReconnect)
          Sets a new repository location for this object.
protected  void setRepositoryCredentials(String uuid, SVNURL rootURL)
          Caches identification parameters (UUID, rood directory location) of the repository with which this driver is working.
abstract  void setRevisionPropertyValue(long revision, String propertyName, SVNPropertyValue propertyValue)
          Sets a revision property with the specified name to a new value.
 void setTunnelProvider(ISVNTunnelProvider tunnelProvider)
          Sets a tunnel provider.
 void status(long revision, String target, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor)
          Gets status of a path.
abstract  void status(long revision, String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor)
          Gets status of a path to the particular depth as a scope.
abstract  void testConnection()
          Tries to access a repository.
protected  void unlock()
           
abstract  void unlock(Map pathToTokens, boolean force, ISVNLockHandler handler)
          Removes lock(s) from the file(s).
 void update(long revision, String target, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor)
          Updates a path receiving changes from a repository.
abstract  void update(long revision, String target, SVNDepth depth, boolean sendCopyFromArgs, ISVNReporterBaton reporter, ISVNEditor editor)
          Updates a path receiving changes from a repository.
 void update(SVNURL url, long revision, String target, boolean recursive, ISVNReporterBaton reporter, ISVNEditor editor)
          Deprecated. use update(SVNURL, long, String, SVNDepth, ISVNReporterBaton, ISVNEditor) instead
abstract  void update(SVNURL url, long revision, String target, SVNDepth depth, ISVNReporterBaton reporter, ISVNEditor editor)
          Asks this repository access object to 'switch' a versioned tree to a new url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INVALID_REVISION

public static final long INVALID_REVISION
Is used as an initialization value in cases, when revision is not defined, often represents HEAD revision

See Also:
Constant Field Values

myRepositoryUUID

protected String myRepositoryUUID

myRepositoryRoot

protected SVNURL myRepositoryRoot

myLocation

protected SVNURL myLocation
Constructor Detail

SVNRepository

protected SVNRepository(SVNURL location,
                        ISVNSession options)
Method Detail

getLocation

public SVNURL getLocation()
Returns the repository location to which this object is set. It may be the location that was used to create this object (see SVNRepositoryFactory.create(SVNURL)), or the recent one the object was set to.

Returns:
a repository location set for this driver
See Also:
setLocation(SVNURL, boolean)

setLocation

public void setLocation(SVNURL url,
                        boolean forceReconnect)
                 throws SVNException
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 url is located within the same repository, this object just switches to that url not closing the current session (i.e. not calling closeSession()).

If either a new url refers 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), or forceReconnect is 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 url
forceReconnect - 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

getRepositoryUUID

public String getRepositoryUUID()
Deprecated. use getRepositoryUUID(boolean) instead

Returns:
the UUID of a repository

getRepositoryUUID

public String getRepositoryUUID(boolean forceConnection)
                         throws SVNException
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 connected
SVNAuthenticationException - in case of authentication problems

getRepositoryRoot

public SVNURL getRepositoryRoot()
Deprecated. use #getRepositoryRoot(boolean) instead

Returns:
the repository root directory location url
See Also:
getRepositoryRoot(boolean)

getRepositoryRoot

public SVNURL getRepositoryRoot(boolean forceConnection)
                         throws SVNException
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, see setLocation()), 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 connected
SVNAuthenticationException - in case of authentication problems
See Also:
testConnection()

setAuthenticationManager

public void setAuthenticationManager(ISVNAuthenticationManager authManager)
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 the SVNWCUtil class for more details.

Parameters:
authManager - an authentication driver to provide user credentials
See Also:
getAuthenticationManager()

getAuthenticationManager

public ISVNAuthenticationManager 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

public void setTunnelProvider(ISVNTunnelProvider tunnelProvider)
Sets a tunnel provider. Actually relevant only to svn+xxx:// scheme cases. The provider is responsible for matching xxx to the tunnel command string.

If one would like to have a standard Subversion behaviour (when tunnel commands are fetched from the config file beneath the section named tunnels), he should provide a default provider (default implementation of the ISVNOptions interface). Refer to SVNWCUtil class for more details on how to get a default options driver.

Parameters:
tunnelProvider - a tunnel provider
See Also:
getTunnelProvider()

getTunnelProvider

public ISVNTunnelProvider getTunnelProvider()
Returns a tunnel provider.

Returns:
a tunnel provider
See Also:
setTunnelProvider(ISVNTunnelProvider)

setCanceller

public void setCanceller(ISVNCanceller canceller)
Sets a canceller to this object.

Parameters:
canceller - canceller object
Since:
1.2.0

getCanceller

public ISVNCanceller getCanceller()
Returns the canceller, stored in this object.

Returns:
canceller object
Since:
1.2.0

setRepositoryCredentials

protected void setRepositoryCredentials(String uuid,
                                        SVNURL rootURL)
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:
getRepositoryRoot(boolean), getRepositoryUUID(boolean)

testConnection

public abstract void testConnection()
                             throws SVNException
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 (see SVNAuthenticationException)

getLatestRevision

public abstract long getLatestRevision()
                                throws SVNException
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 (see SVNAuthenticationException)

getDatedRevision

public abstract long getDatedRevision(Date date)
                               throws SVNException
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 (see SVNAuthenticationException)

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 number
properties - 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:
  • revision number is invalid
  • there's no such revision at all
  • a failure occured while connecting to a repository
  • the user authentication failed (see SVNAuthenticationException)
See Also:
SVNRevisionProperty

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 changed
propertyName - a revision property name
propertyValue - 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)
  • revision is invalid or doesn't exist at all
  • a failure occured while connecting to a repository
  • the user authentication failed (see SVNAuthenticationException)
See Also:
SVNRevisionProperty

getRevisionPropertyValue

public abstract SVNPropertyValue getRevisionPropertyValue(long revision,
                                                          String propertyName)
                                                   throws SVNException
Gets the value of an unversioned property.

Parameters:
revision - a revision number
propertyName - a property name
Returns:
a revision property value or null if there's no such revision property
Throws:
SVNException - in the following cases:
  • revision number is invalid or if there's no such revision at all.
  • a failure occured while connecting to a repository
  • the user authentication failed (see SVNAuthenticationException)

checkPath

public abstract SVNNodeKind checkPath(String path,
                                      long revision)
                               throws SVNException
Returns the kind of an item located at the specified path in a particular revision. If the path does not exist under the specified revision, SVNNodeKind.NONE will be returned.

The path arg can be both relative to the location of this driver and absolute to the repository root (starts with "/").

Parameters:
path - an item's path
revision - a revision number
Returns:
the node kind for the given path at the given revision
Throws:
SVNException - if a failure occured while connecting to a repository or the user's authentication failed (see SVNAuthenticationException)

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 contents arg is not null it will be written with file contents.

If properties arg 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 path arg can be both relative to the location of this driver and absolute to the repository root (starts with "/").

If revision is invalid (negative), HEAD revision will be used.

Parameters:
path - a file path
revision - a file revision
properties - a file properties receiver map
contents - 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 path in revision
  • a failure occured while connecting to a repository
  • the user authentication failed (see SVNAuthenticationException)

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) with entryFields parameter set to DIRENT_ALL.

Parameters:
path - a directory path
revision - a directory revision
properties - a directory properties receiver map
handler - a handler to process directory entries
Returns:
the revision of the directory
Throws:
SVNException - in the following cases:
  • path not found in the specified revision
  • path is not a directory
  • a failure occured while connecting to a repository
  • the user authentication failed (see SVNAuthenticationException)
See Also:
getDir(String, long, boolean, Collection), getDir(String, long, SVNProperties, int, Collection), SVNDirEntry

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 handler arg is not null it will be dispatched information of each directory entry represented by an SVNDirEntry object.

If properties arg 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 path arg can be both relative to the location of this driver and absolute to the repository root (starts with "/").

If revision is invalid (negative), HEAD revision will be used. NOTE: you may not invoke operation methods of this SVNRepository object from within the provided handler.

Parameters:
path - a directory path
revision - a directory revision
properties - a directory properties receiver map
entryFields - a combination of fields for the entry
handler - a handler to process directory entries
Returns:
the revision of the directory
Throws:
SVNException - in the following cases:
  • path not found in the specified revision
  • path is not a directory
  • a failure occured while connecting to a repository
  • the user authentication failed (see SVNAuthenticationException)
See Also:
getDir(String, long, boolean, Collection), getDir(String, long, SVNProperties, int, Collection), SVNDirEntry

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 startRevision and so on - up to the endRevision. If the method succeeds, the provided handler will have been invoked at least once.

For the first interesting revision the file contents will be provided to the handler as a text delta against an empty file. For the following revisions, the delta will be against the fulltext contents of the previous revision.

The path arg can be both relative to the location of this driver and absolute to the repository root (starts with "/").

NOTES:

Parameters:
path - a file path
startRevision - a revision to start from
endRevision - a revision to stop at
handler - 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 (see SVNAuthenticationException)
Since:
SVN 1.1
See Also:
getFileRevisions(String, Collection, long, long), SVNFileRevision

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 startRevision and so on - up to the endRevision. If includeMergedRevisions is true, then revisions which were result of a merge will be included as well. If the method succeeds, the provided handler will have been invoked at least once.

For the first interesting revision the file contents will be provided to the handler as a text delta against an empty file. For the following revisions, the delta will be against the fulltext contents of the previous revision.

The path arg can be both relative to the location of this driver and absolute to the repository root (starts with "/").

NOTES: