public class SVNBasicDelegate extends java.lang.Object implements ISVNEventHandler
All of SVN*Client classes use inherited methods of
SVNBasicClient to access Working Copies metadata, to create a driver
object to access a repository if it's necessary, etc. In addition
SVNBasicClient provides some interface methods - such as those that
allow you to set your event handler
, obtain run-time
configuration options, and others.
Modifier and Type | Class and Description |
---|---|
protected static class |
SVNBasicDelegate.RepositoryReference |
protected static class |
SVNBasicDelegate.SVNRepositoryLocation |
UNKNOWN
NULL
Modifier | Constructor and Description |
---|---|
|
SVNBasicDelegate(ISVNAuthenticationManager authManager,
ISVNOptions options) |
protected |
SVNBasicDelegate(ISVNRepositoryPool repositoryPool,
ISVNOptions options) |
Modifier and Type | Method and Description |
---|---|
void |
checkCancelled()
Redirects this call to the registered event handler (if any).
|
protected SVNRepository |
createRepository(SVNURL url,
java.io.File path,
SVNAdminArea area,
SVNRevision pegRevision,
SVNRevision revision,
long[] pegRev) |
protected SVNRepository |
createRepository(SVNURL url,
java.io.File path,
SVNWCAccess access,
boolean mayReuse) |
protected SVNRepository |
createRepository(SVNURL url,
java.lang.String uuid,
boolean mayReuse) |
protected SVNWCAccess |
createWCAccess() |
protected SVNWCAccess |
createWCAccess(java.lang.String pathPrefix) |
protected SVNURL |
deriveLocation(java.io.File path,
SVNURL url,
long[] pegRevisionNumber,
SVNRevision pegRevision,
SVNRepository repos,
SVNWCAccess access) |
protected void |
dispatchEvent(SVNEvent event) |
protected void |
dispatchEvent(SVNEvent event,
double progress) |
protected void |
elideMergeInfo(SVNWCAccess access,
java.io.File path,
SVNEntry entry,
java.io.File wcElisionLimitPath) |
protected SVNURL |
ensureSessionURL(SVNRepository repository,
SVNURL url) |
ISVNDebugLog |
getDebugLog()
Returns the debug logger currently in use.
|
protected SVNURL |
getEntryLocation(java.io.File path,
SVNEntry entry,
long[] revNum,
SVNRevision pegRevision) |
protected ISVNEventHandler |
getEventDispatcher() |
protected int |
getLevelsToLockFromDepth(SVNDepth depth) |
protected SVNBasicDelegate.SVNRepositoryLocation[] |
getLocations(SVNURL url,
java.io.File path,
SVNRepository repository,
SVNRevision revision,
SVNRevision start,
SVNRevision end) |
ISVNOptions |
getOptions()
Gets run-time configuration options used by this object.
|
protected long |
getPathLastChangeRevision(java.lang.String relPath,
long revision,
SVNRepository repository) |
protected java.lang.String |
getPathRelativeToRoot(java.io.File path,
SVNURL url,
SVNURL reposRootURL,
SVNWCAccess wcAccess,
SVNRepository repos) |
protected java.lang.String |
getPathRelativeToSession(SVNURL url,
SVNURL sessionURL,
SVNRepository repos) |
protected ISVNRepositoryPool |
getRepositoryPool() |
protected java.util.Map |
getReposMergeInfo(SVNRepository repository,
java.lang.String path,
long revision,
SVNMergeInfoInheritance inheritance,
boolean squelchIncapable) |
SVNURL |
getReposRoot(java.io.File path,
SVNURL url,
SVNRevision pegRevision,
SVNAdminArea adminArea,
SVNWCAccess access)
Returns the root of the repository.
|
protected long |
getRevisionNumber(SVNRevision revision,
long[] latestRevisionNumber,
SVNRepository repository,
java.io.File path) |
protected long |
getRevisionNumber(SVNRevision revision,
SVNRepository repository,
java.io.File path) |
protected SVNURL |
getURL(java.io.File path) |
protected java.util.Map |
getWCMergeInfo(java.io.File path,
SVNEntry entry,
java.io.File limitPath,
SVNMergeInfoInheritance inherit,
boolean base,
boolean[] inherited)
mergeInfo must not be null!
|
protected java.util.Map |
getWCOrRepositoryMergeInfo(java.io.File path,
SVNEntry entry,
SVNMergeInfoInheritance inherit,
boolean[] indirect,
boolean reposOnly,
SVNRepository repository) |
void |
handleEvent(SVNEvent event,
double progress)
Dispatches events to the registered event handler (if any).
|
void |
handlePathListItem(java.io.File path)
Handles a next working copy path with the
path
list handler if any was provided to this object through
setPathListHandler(ISVNPathListHandler) . |
boolean |
isIgnoreExternals()
Determines if externals definitions are ignored.
|
boolean |
isLeaveConflictsUnresolved()
Deprecated.
this method should not be used anymore
|
protected SVNRevision[] |
resolveRevisions(SVNRevision pegRevision,
SVNRevision revision,
boolean isURL,
boolean noticeLocalModifications) |
protected void |
setCommitItemAccess(SVNCommitItem item,
SVNWCAccess access) |
protected void |
setCommitItemFlags(SVNCommitItem item,
boolean contentModified,
boolean propertiesModified) |
protected void |
setCommitItemProperty(SVNCommitItem item,
java.lang.String name,
SVNPropertyValue value) |
void |
setDebugLog(ISVNDebugLog log)
Sets a logger to write debug log information to.
|
void |
setEventHandler(ISVNEventHandler dispatcher)
Sets an event handler for this object.
|
void |
setEventPathPrefix(java.lang.String prefix)
Removes or adds a path prefix.
|
void |
setIgnoreExternals(boolean ignore)
Sets externals definitions to be ignored or not during operations.
|
void |
setLeaveConflictsUnresolved(boolean leave)
Deprecated.
this method should not be used anymore
|
void |
setOptions(ISVNOptions options)
Sets run-time global configuration options to this object.
|
void |
setPathListHandler(ISVNPathListHandler handler)
Sets a path list handler implementation to this object.
|
protected void |
sleepForTimeStamp() |
public SVNBasicDelegate(ISVNAuthenticationManager authManager, ISVNOptions options)
protected SVNBasicDelegate(ISVNRepositoryPool repositoryPool, ISVNOptions options)
public ISVNOptions getOptions()
public void setOptions(ISVNOptions options)
options
- the run-time configuration optionspublic void setIgnoreExternals(boolean ignore)
For example, if external definitions are set to be ignored then a checkout operation won't fetch them into a Working Copy.
ignore
- true to ignore externals
definitions, false - not toisIgnoreExternals()
public boolean isIgnoreExternals()
setIgnoreExternals(boolean)
public void setLeaveConflictsUnresolved(boolean leave)
By default when a file receives changes from the repository that are in conflict with local edits, an update operation places two sections for each conflicting snatch into the working file one of which is a user's local edit and the second is the one just received from the repository. Like this:
<<<<<<< .mine user's text ======= received text >>>>>>> .r2
leave
set to true, an
update will still create temporary files but won't place those two
sections into your working file. And this behaviour also concerns merge
operations: any merging to a conflicted file will be prevented. In
addition if there is any registered event handler for an
SVNDiffClient or SVNUpdateClient instance then the handler
will be dispatched an event with the status type set to
SVNStatusType.CONFLICTED_UNRESOLVED
.
The default value is false until a caller explicitly changes it calling this method.
leave
- true to prevent conflicted
files from merging (all merging operations will be skipped),
otherwise falseisLeaveConflictsUnresolved()
,
SVNUpdateClient
,
SVNDiffClient
,
ISVNEventHandler
public boolean isLeaveConflictsUnresolved()
setLeaveConflictsUnresolved(boolean)
public void setEventHandler(ISVNEventHandler dispatcher)
SVNEvent
objects to provide detailed information about
actions and progress state of version control operations performed by
do*() methods of SVN*Client classes.dispatcher
- an event handlerpublic void setPathListHandler(ISVNPathListHandler handler)
handler
- handler implementationpublic void setDebugLog(ISVNDebugLog log)
log
- a debug loggerpublic ISVNDebugLog getDebugLog()
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.
public SVNURL getReposRoot(java.io.File path, SVNURL url, SVNRevision pegRevision, SVNAdminArea adminArea, SVNWCAccess access) throws SVNException
path
is not null and
pegRevision
is either SVNRevision.WORKING
or
SVNRevision.BASE
, then attempts to fetch the repository root from
the working copy represented by path
. If these conditions
are not met or if the repository root is not recorded in the working
copy, then a repository connection is established and the repository root
is fetched from the session.
When fetching the repository root from the working copy and if
access
is null, a new
working copy access will be created and the working copy will be opened
non-recursively for reading only.
All necessary cleanup (session or|and working copy close) will be
performed automatically as the routine finishes.path
- working copy pathurl
- repository urlpegRevision
- revision in which the target is validadminArea
- working copy administrative area objectaccess
- working copy access objectSVNException
protected void sleepForTimeStamp()
protected SVNRepository createRepository(SVNURL url, java.io.File path, SVNWCAccess access, boolean mayReuse) throws SVNException
SVNException
protected SVNRepository createRepository(SVNURL url, java.lang.String uuid, boolean mayReuse) throws SVNException
SVNException
protected ISVNRepositoryPool getRepositoryPool()
protected void dispatchEvent(SVNEvent event) throws SVNException
SVNException
protected void dispatchEvent(SVNEvent event, double progress) throws SVNException
SVNException
public void setEventPathPrefix(java.lang.String prefix)
prefix
- a path prefixprotected ISVNEventHandler getEventDispatcher()
protected SVNWCAccess createWCAccess()
protected SVNWCAccess createWCAccess(java.lang.String pathPrefix)
public void handleEvent(SVNEvent event, double progress) throws SVNException
handleEvent
in interface ISVNEventHandler
event
- the current eventprogress
- progress state (from 0 to 1)SVNException
public void handlePathListItem(java.io.File path) throws SVNException
path
list handler
if any was provided to this object through
setPathListHandler(ISVNPathListHandler)
.
Note: used by SVNKit
internals.path
- working copy pathSVNException
public void checkCancelled() throws SVNCancelException
checkCancelled
in interface ISVNCanceller
SVNCancelException
- if the current operation was cancelledprotected long getRevisionNumber(SVNRevision revision, SVNRepository repository, java.io.File path) throws SVNException
SVNException
protected long getRevisionNumber(SVNRevision revision, long[] latestRevisionNumber, SVNRepository repository, java.io.File path) throws SVNException
SVNException
protected SVNRepository createRepository(SVNURL url, java.io.File path, SVNAdminArea area, SVNRevision pegRevision, SVNRevision revision, long[] pegRev) throws SVNException
SVNException
protected SVNRevision[] resolveRevisions(SVNRevision pegRevision, SVNRevision revision, boolean isURL, boolean noticeLocalModifications)
protected void elideMergeInfo(SVNWCAccess access, java.io.File path, SVNEntry entry, java.io.File wcElisionLimitPath) throws SVNException
SVNException
protected java.util.Map getReposMergeInfo(SVNRepository repository, java.lang.String path, long revision, SVNMergeInfoInheritance inheritance, boolean squelchIncapable) throws SVNException
path
- path relative to the repository location.SVNException
protected java.util.Map getWCOrRepositoryMergeInfo(java.io.File path, SVNEntry entry, SVNMergeInfoInheritance inherit, boolean[] indirect, boolean reposOnly, SVNRepository repository) throws SVNException
SVNException
protected java.util.Map getWCMergeInfo(java.io.File path, SVNEntry entry, java.io.File limitPath, SVNMergeInfoInheritance inherit, boolean base, boolean[] inherited) throws SVNException
SVNException
protected long getPathLastChangeRevision(java.lang.String relPath, long revision, SVNRepository repository) throws SVNException
SVNException
protected java.lang.String getPathRelativeToRoot(java.io.File path, SVNURL url, SVNURL reposRootURL, SVNWCAccess wcAccess, SVNRepository repos) throws SVNException
SVNException
protected java.lang.String getPathRelativeToSession(SVNURL url, SVNURL sessionURL, SVNRepository repos)
protected SVNBasicDelegate.SVNRepositoryLocation[] getLocations(SVNURL url, java.io.File path, SVNRepository repository, SVNRevision revision, SVNRevision start, SVNRevision end) throws SVNException
SVNException
protected SVNURL getURL(java.io.File path) throws SVNException
SVNException
protected SVNURL deriveLocation(java.io.File path, SVNURL url, long[] pegRevisionNumber, SVNRevision pegRevision, SVNRepository repos, SVNWCAccess access) throws SVNException
SVNException
protected SVNURL getEntryLocation(java.io.File path, SVNEntry entry, long[] revNum, SVNRevision pegRevision) throws SVNException
SVNException
protected SVNURL ensureSessionURL(SVNRepository repository, SVNURL url) throws SVNException
SVNException
protected int getLevelsToLockFromDepth(SVNDepth depth)
protected void setCommitItemAccess(SVNCommitItem item, SVNWCAccess access)
protected void setCommitItemProperty(SVNCommitItem item, java.lang.String name, SVNPropertyValue value)
protected void setCommitItemFlags(SVNCommitItem item, boolean contentModified, boolean propertiesModified)
Copyright © 2004-2012 TMate Software Ltd. All Rights Reserved.