org.tigris.subversion.javahl
Class SVNClientSynchronized

java.lang.Object
  |
  +--org.tigris.subversion.javahl.SVNClientSynchronized
All Implemented Interfaces:
SVNClientInterface

public class SVNClientSynchronized
extends java.lang.Object
implements SVNClientInterface

This class provides a threadsafe wrapped for SVNClient


Constructor Summary
SVNClientSynchronized()
          Create our worker
 
Method Summary
 void add(java.lang.String path, boolean recurse)
          Adds a file to the repository.
 byte[] blame(java.lang.String path, Revision revisionStart, Revision revisionEnd)
          Deprecated.  
 void blame(java.lang.String path, Revision revisionStart, Revision revisionEnd, BlameCallback callback)
          Retrieve the content together with the author, the revision and the date of the last change of each line
 void cancelOperation()
          cancel the active operation
 long checkout(java.lang.String moduleName, java.lang.String destPath, Revision revision, boolean recurse)
          Executes a revision checkout.
 void cleanup(java.lang.String path)
          Recursively cleans up a local directory, finishing any incomplete operations, removing lockfiles, etc.
 long commit(java.lang.String[] path, java.lang.String message, boolean recurse)
          Commits changes to the repository.
 void commitMessageHandler(CommitMessage messageHandler)
          Sets the commit message handler.
 void copy(java.lang.String srcPath, java.lang.String destPath, java.lang.String message, Revision revision)
          Copies a versioned file with the history preserved.
 void diff(java.lang.String target1, Revision revision1, java.lang.String target2, Revision revision2, java.lang.String outFileName, boolean recurse)
          Display the differences between two paths
 void dispose()
          release the native peer (should not depend on finalize)
 long doExport(java.lang.String srcPath, java.lang.String destPath, Revision revision, boolean force)
          Exports the contents of either a subversion repository into a 'clean' directory (meaning a directory with no administrative directories).
 void doImport(java.lang.String path, java.lang.String url, java.lang.String message, boolean recurse)
          Import a file or directory into a repository directory at head.
 long doSwitch(java.lang.String path, java.lang.String url, Revision revision, boolean recurse)
          Update local copy to mirror a new url.
 byte[] fileContent(java.lang.String path, Revision revision)
          Retrieve the content of a file
 java.lang.String getConfigDirectory()
          Get the configuration directory
 java.lang.String getLastPath()
          Deprecated.  
 Info info(java.lang.String path)
          Retrieves the working copy information for an item
 DirEntry[] list(java.lang.String url, Revision revision, boolean recurse)
          Lists the directory entries of an url on the server.
 LogMessage[] logMessages(java.lang.String path, Revision revisionStart, Revision revisionEnd)
          Retrieve the log messages for an item
 LogMessage[] logMessages(java.lang.String path, Revision revisionStart, Revision revisionEnd, boolean stopOnCopy)
          Retrieve the log messages for an item
 LogMessage[] logMessages(java.lang.String path, Revision revisionStart, Revision revisionEnd, boolean stopOnCopy, boolean discoverPath)
          Retrieve the log messages for an item
 void merge(java.lang.String path1, Revision revision1, java.lang.String path2, Revision revision2, java.lang.String localPath, boolean force, boolean recurse)
          Merge changes from two paths into a new local path.
 void mkdir(java.lang.String[] path, java.lang.String message)
          Creates a directory directly in a repository or creates a directory on disk and schedules it for addition.
 void move(java.lang.String srcPath, java.lang.String destPath, java.lang.String message, Revision revision, boolean force)
          Moves or renames a file.
 void notification(Notify notify)
          Sets the notification callback used to send processing information back to the calling program.
 void password(java.lang.String password)
          Sets the password used for authification.
 PropertyData[] properties(java.lang.String path)
          Retrieves the properties of an item
 void propertyCreate(java.lang.String path, java.lang.String name, byte[] value, boolean recurse)
          Create and sets one property of an item with a byte array value
 void propertyCreate(java.lang.String path, java.lang.String name, java.lang.String value, boolean recurse)
          Create and sets one property of an item with a String value
 PropertyData propertyGet(java.lang.String path, java.lang.String name)
          Retrieve one property of one iten
 void propertyRemove(java.lang.String path, java.lang.String name, boolean recurse)
          Remove one property of an item.
 void propertySet(java.lang.String path, java.lang.String name, byte[] value, boolean recurse)
          Sets one property of an item with a byte array value
 void propertySet(java.lang.String path, java.lang.String name, java.lang.String value, boolean recurse)
          Sets one property of an item with a String value
 void relocate(java.lang.String from, java.lang.String to, java.lang.String path, boolean recurse)
          Rewrite the url's in the working copy
 void remove(java.lang.String[] path, java.lang.String message, boolean force)
          Sets a file for deletion.
 void resolved(java.lang.String path, boolean recurse)
          Removes the 'conflicted' state on a file.
 void revert(java.lang.String path, boolean recurse)
          Reverts a file to a pristine state.
 PropertyData revProperty(java.lang.String path, java.lang.String name, Revision rev)
          Retrieve one revsision property of one item
 void setConfigDirectory(java.lang.String configDir)
          Set directory for the configuration information
 void setPrompt(PromptUserPassword prompt)
          Register callback interface to supply username and password on demand
 Status singleStatus(java.lang.String path, boolean onServer)
          Returns the status of a single file in the path.
 Status[] status(java.lang.String path, boolean descend, boolean onServer, boolean getAll)
          List a directory or file of the working copy.
 Status[] status(java.lang.String path, boolean descend, boolean onServer, boolean getAll, boolean noIgnore)
          List a directory or file of the working copy.
 long update(java.lang.String path, Revision revision, boolean recurse)
          Updates the directory or file from repository
 void username(java.lang.String username)
          Sets the username used for authentification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVNClientSynchronized

public SVNClientSynchronized()
Create our worker
Method Detail

dispose

public void dispose()
release the native peer (should not depend on finalize)
Specified by:
dispose in interface SVNClientInterface

getLastPath

public java.lang.String getLastPath()
Deprecated.  

Returns the last destination path submitted.
Specified by:
getLastPath in interface SVNClientInterface
Returns:
path in Subversion format.

status

public Status[] status(java.lang.String path,
                       boolean descend,
                       boolean onServer,
                       boolean getAll)
                throws ClientException
List a directory or file of the working copy.
Specified by:
status in interface SVNClientInterface
Parameters:
path - Path to explore.
descend - Recurse into subdirectories if existant.
onServer - Request status information from server.
getAll - get status for uninteristing files (unchanged).
Returns:
Array of Status entries.

status

public Status[] status(java.lang.String path,
                       boolean descend,
                       boolean onServer,
                       boolean getAll,
                       boolean noIgnore)
                throws ClientException
List a directory or file of the working copy.
Specified by:
status in interface SVNClientInterface
Parameters:
path - Path to explore.
descend - Recurse into subdirectories if existant.
onServer - Request status information from server.
getAll - get status for uninteristing files (unchanged).
noIgnore - get status for normaly ignored files and directories.
Returns:
Array of Status entries.

list

public DirEntry[] list(java.lang.String url,
                       Revision revision,
                       boolean recurse)
                throws ClientException
Lists the directory entries of an url on the server.
Specified by:
list in interface SVNClientInterface
Parameters:
url - the url to list
revision - the revision to list
recurse - recurse into subdirectories
Returns:
Array of DirEntry objects.

singleStatus

public Status singleStatus(java.lang.String path,
                           boolean onServer)
                    throws ClientException
Returns the status of a single file in the path.
Specified by:
singleStatus in interface SVNClientInterface
Parameters:
path - File to gather status.
onServer - Request status information from the server.
Returns:
the subversion status of the file.

username

public void username(java.lang.String username)
Sets the username used for authentification.
Specified by:
username in interface SVNClientInterface
Parameters:
username - the username

password

public void password(java.lang.String password)
Sets the password used for authification.
Specified by:
password in interface SVNClientInterface
Parameters:
password - the password

setPrompt

public void setPrompt(PromptUserPassword prompt)
Register callback interface to supply username and password on demand
Specified by:
setPrompt in interface SVNClientInterface
Parameters:
prompt - the callback interface

logMessages

public LogMessage[] logMessages(java.lang.String path,
                                Revision revisionStart,
                                Revision revisionEnd)
                         throws ClientException
Retrieve the log messages for an item
Specified by:
logMessages in interface SVNClientInterface
Parameters:
path - path or url to get the log message for.
revisionStart - first revision to show
revisionEnd - last revision to show
Returns:
array of LogMessages

logMessages

public LogMessage[] logMessages(java.lang.String path,
                                Revision revisionStart,
                                Revision revisionEnd,
                                boolean stopOnCopy)
                         throws ClientException
Retrieve the log messages for an item
Specified by:
logMessages in interface SVNClientInterface
Parameters:
path - path or url to get the log message for.
revisionStart - first revision to show
revisionEnd - last revision to show
stopOnCopy - do not continue on copy operations
Returns:
array of LogMessages

logMessages

public LogMessage[] logMessages(java.lang.String path,
                                Revision revisionStart,
                                Revision revisionEnd,
                                boolean stopOnCopy,
                                boolean discoverPath)
                         throws ClientException
Retrieve the log messages for an item
Specified by:
logMessages in interface SVNClientInterface
Parameters:
path - path or url to get the log message for.
revisionStart - first revision to show
revisionEnd - last revision to show
stopOnCopy - do not continue on copy operations
discoverPath - returns the paths of the changed items in the returned objects
Returns:
array of LogMessages

checkout

public long checkout(java.lang.String moduleName,
                     java.lang.String destPath,
                     Revision revision,
                     boolean recurse)
              throws ClientException
Executes a revision checkout.
Specified by:
checkout in interface SVNClientInterface
Parameters:
moduleName - name of the module to checkout.
destPath - destination directory for checkout.
revision - the revision to checkout.
recurse - whether you want it to checkout files recursively.
Throws:
ClientException -  

notification

public void notification(Notify notify)
Sets the notification callback used to send processing information back to the calling program.
Specified by:
notification in interface SVNClientInterface
Parameters:
notify - listener that the SVN library should call on many file operations.

commitMessageHandler

public void commitMessageHandler(CommitMessage messageHandler)
Sets the commit message handler. This allows more complex commit message with the list of the elements to be commited as input.
Specified by:
commitMessageHandler in interface SVNClientInterface
Parameters:
messageHandler - callback for entering commit messages if this is set the message parameter is ignored.

remove

public void remove(java.lang.String[] path,
                   java.lang.String message,
                   boolean force)
            throws ClientException
Sets a file for deletion.
Specified by:
remove in interface SVNClientInterface
Parameters:
path - path or url to be deleted
message - if path is a url, this will be the commit message.
force - delete even when there are local modifications.
Throws:
ClientException -  

revert

public void revert(java.lang.String path,
                   boolean recurse)
            throws ClientException
Reverts a file to a pristine state.
Specified by:
revert in interface SVNClientInterface
Parameters:
path - path of the file.
recurse - recurse into subdirectories
Throws:
ClientException -  

add

public void add(java.lang.String path,
                boolean recurse)
         throws ClientException
Adds a file to the repository.
Specified by:
add in interface SVNClientInterface
Parameters:
path - path to be added.
recurse - recurse into subdirectories
Throws:
ClientException -  

update

public long update(java.lang.String path,
                   Revision revision,
                   boolean recurse)
            throws ClientException
Updates the directory or file from repository
Specified by:
update in interface SVNClientInterface
Parameters:
path - target file.
revision - the revision number to checkout. Revision.HEAD will checkout the latest revision.
recurse - recursively update.
Throws:
ClientException -  

commit

public long commit(java.lang.String[] path,
                   java.lang.String message,
                   boolean recurse)
            throws ClientException
Commits changes to the repository.
Specified by:
commit in interface SVNClientInterface
Parameters:
path - files to commit.
message - log message.
recurse - whether the operation should be done recursively.
Returns:
Returns a long representing the revision. It returns a -1 if the revision number is invalid.
Throws:
ClientException -  

copy

public void copy(java.lang.String srcPath,
                 java.lang.String destPath,
                 java.lang.String message,
                 Revision revision)
          throws ClientException
Copies a versioned file with the history preserved.
Specified by:
copy in interface SVNClientInterface
Parameters:
srcPath - source path or url
destPath - destination path or url
message - commit message if destPath is an url
revision - source revision
Throws:
ClientException -  

move

public void move(java.lang.String srcPath,
                 java.lang.String destPath,
                 java.lang.String message,
                 Revision revision,
                 boolean force)
          throws ClientException
Moves or renames a file.
Specified by:
move in interface SVNClientInterface
Parameters:
srcPath - source path or url
destPath - destination path or url
message - commit message if destPath is an url
revision - source revision
force - even with local modifications.
Throws:
ClientException -  

mkdir

public void mkdir(java.lang.String[] path,
                  java.lang.String message)
           throws ClientException
Creates a directory directly in a repository or creates a directory on disk and schedules it for addition.
Specified by:
mkdir in interface SVNClientInterface
Parameters:
path - directories to be created
message - commit message to used if path contains urls
Throws:
ClientException -  

cleanup

public void cleanup(java.lang.String path)
             throws ClientException
Recursively cleans up a local directory, finishing any incomplete operations, removing lockfiles, etc.
Specified by:
cleanup in interface SVNClientInterface
Parameters:
path - a local directory.
Throws:
ClientException -  

resolved

public void resolved(java.lang.String path,
                     boolean recurse)
              throws ClientException
Removes the 'conflicted' state on a file.
Specified by:
resolved in interface SVNClientInterface
Parameters:
path - path to cleanup
recurse - recurce into subdirectories
Throws:
ClientException -  

doExport

public long doExport(java.lang.String srcPath,
                     java.lang.String destPath,
                     Revision revision,
                     boolean force)
              throws ClientException
Exports the contents of either a subversion repository into a 'clean' directory (meaning a directory with no administrative directories).
Specified by:
doExport in interface SVNClientInterface
Parameters:
srcPath - the url of the repository path to be exported
destPath - a destination path that must not already exist.
revision - the revsion to be exported
force - set if it is ok to overwrite local files
Throws:
ClientException -  

doSwitch

public long doSwitch(java.lang.String path,
                     java.lang.String url,
                     Revision revision,
                     boolean recurse)
              throws ClientException
Update local copy to mirror a new url.
Specified by:
doSwitch in interface SVNClientInterface
Parameters:
path - the working copy path
url - the new url for the working copy
revision - the new base revision of working copy
recurse - traverse into subdirectories
Throws:
ClientException -  

doImport

public void doImport(java.lang.String path,
                     java.lang.String url,
                     java.lang.String message,
                     boolean recurse)
              throws ClientException
Import a file or directory into a repository directory at head.
Specified by:
doImport in interface SVNClientInterface
Parameters:
path - the local path
url - the target url
message - the log message.
recurse - traverse into subdirectories
Throws:
ClientException -  

merge

public void merge(java.lang.String path1,
                  Revision revision1,
                  java.lang.String path2,
                  Revision revision2,
                  java.lang.String localPath,
                  boolean force,
                  boolean recurse)
           throws ClientException
Merge changes from two paths into a new local path.
Specified by:
merge in interface SVNClientInterface
Parameters:
path1 - first path or url
revision1 - first revision
path2 - second path or url
revision2 - second revision
localPath - target local path
force - overwrite local changes
recurse - traverse into subdirectories
Throws:
ClientException -  

diff

public void diff(java.lang.String target1,
                 Revision revision1,
                 java.lang.String target2,
                 Revision revision2,
                 java.lang.String outFileName,
                 boolean recurse)
          throws ClientException
Display the differences between two paths
Specified by:
diff in interface SVNClientInterface
Parameters:
target1 - first path or url
revision1 - first revision
target2 - second path or url
revision2 - second revision
outFileName - file name where difference are written
recurse - traverse into subdirectories
Throws:
ClientException -  

properties

public PropertyData[] properties(java.lang.String path)
                          throws ClientException
Retrieves the properties of an item
Specified by:
properties in interface SVNClientInterface
Parameters:
path - the path of the item
Returns:
array of property objects

propertySet

public void propertySet(java.lang.String path,
                        java.lang.String name,
                        java.lang.String value,
                        boolean recurse)
                 throws ClientException
Sets one property of an item with a String value
Specified by:
propertySet in interface SVNClientInterface
Parameters:
path - path of the item
name - name of the property
value - new value of the property
recurse - set property also on the subdirectories
Throws:
ClientException -  

propertySet

public void propertySet(java.lang.String path,
                        java.lang.String name,
                        byte[] value,
                        boolean recurse)
                 throws ClientException
Sets one property of an item with a byte array value
Specified by:
propertySet in interface SVNClientInterface
Parameters:
path - path of the item
name - name of the property
value - new value of the property
recurse - set property also on the subdirectories
Throws:
ClientException -  

propertyRemove

public void propertyRemove(java.lang.String path,
                           java.lang.String name,
                           boolean recurse)
                    throws ClientException
Remove one property of an item.
Specified by:
propertyRemove in interface SVNClientInterface
Parameters:
path - path of the item
name - name of the property
recurse - remove the property also on subdirectories
Throws:
ClientException -  

propertyCreate

public void propertyCreate(java.lang.String path,
                           java.lang.String name,
                           java.lang.String value,
                           boolean recurse)
                    throws ClientException
Create and sets one property of an item with a String value
Specified by:
propertyCreate in interface SVNClientInterface
Parameters:
path - path of the item
name - name of the property
value - new value of the property
recurse - set property also on the subdirectories
Throws:
ClientException -  

propertyCreate

public void propertyCreate(java.lang.String path,
                           java.lang.String name,
                           byte[] value,
                           boolean recurse)
                    throws ClientException
Create and sets one property of an item with a byte array value
Specified by:
propertyCreate in interface SVNClientInterface
Parameters:
path - path of the item
name - name of the property
value - new value of the property
recurse - set property also on the subdirectories
Throws:
ClientException -  

revProperty

public PropertyData revProperty(java.lang.String path,
                                java.lang.String name,
                                Revision rev)
                         throws ClientException
Retrieve one revsision property of one item
Specified by:
revProperty in interface SVNClientInterface
Parameters:
path - path of the item
name - name of the property
rev - revision to retrieve
Returns:
the Property
Throws:
ClientException -  

propertyGet

public PropertyData propertyGet(java.lang.String path,
                                java.lang.String name)
                         throws ClientException
Retrieve one property of one iten
Specified by:
propertyGet in interface SVNClientInterface
Parameters:
path - path of the item
name - name of property
Returns:
the Property
Throws:
ClientException -  

fileContent

public byte[] fileContent(java.lang.String path,
                          Revision revision)
                   throws ClientException
Retrieve the content of a file
Specified by:
fileContent in interface SVNClientInterface
Parameters:
path - the path of the file
revision - the revision to retrieve
Returns:
the content as byte array
Throws:
ClientException -  

relocate

public void relocate(java.lang.String from,
                     java.lang.String to,
                     java.lang.String path,
                     boolean recurse)
              throws ClientException
Rewrite the url's in the working copy
Specified by:
relocate in interface SVNClientInterface
Parameters:
from - old url
to - new url
path - working copy path
recurse - recurse into subdirectories
Throws:
ClientException -  

blame

public byte[] blame(java.lang.String path,
                    Revision revisionStart,
                    Revision revisionEnd)
             throws ClientException
Deprecated.  

Return for each line of the file, the author and the revision of the last together with the content.
Specified by:
blame in interface SVNClientInterface
Parameters:
path - the path
revisionStart - the first revision to show
revisionEnd - the last revision to show
Returns:
the content together with author and revision of last change
Throws:
ClientException -  

blame

public void blame(java.lang.String path,
                  Revision revisionStart,
                  Revision revisionEnd,
                  BlameCallback callback)
           throws ClientException
Retrieve the content together with the author, the revision and the date of the last change of each line
Specified by:
blame in interface SVNClientInterface
Parameters:
path - the path
revisionStart - the first revision to show
revisionEnd - the last revision to show
callback - callback to receive the file content and the other information
Throws:
ClientException -  

setConfigDirectory

public void setConfigDirectory(java.lang.String configDir)
                        throws ClientException
Set directory for the configuration information
Specified by:
setConfigDirectory in interface SVNClientInterface
Parameters:
configDir - path of the directory
Throws:
ClientException -  

getConfigDirectory

public java.lang.String getConfigDirectory()
                                    throws ClientException
Get the configuration directory
Specified by:
getConfigDirectory in interface SVNClientInterface
Returns:
the directory
Throws:
ClientException -  

cancelOperation

public void cancelOperation()
                     throws ClientException
cancel the active operation
Specified by:
cancelOperation in interface SVNClientInterface
Throws:
ClientException -  

info

public Info info(java.lang.String path)
          throws ClientException
Retrieves the working copy information for an item
Specified by:
info in interface SVNClientInterface
Parameters:
path - path of the item
Returns:
the information object
Throws:
ClientException -