public class SVNRunnable extends net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent implements Runnable, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean
Runnable that communications with a Subversion server (via a spool directory).| Modifier and Type | Field and Description |
|---|---|
private org.tmatesoft.svn.core.wc.SVNClientManager |
clientManager
SVN Client manager.
|
private Logger |
log
Class logger.
|
private org.tmatesoft.svn.core.SVNURL |
remoteRepository
URL to the remote repository.
|
private org.tmatesoft.svn.core.wc.SVNRevision |
retrievalRevision
Revision of the working copy.
|
private File |
workingCopyDirectory
Directory where the working copy will be kept.
|
| Constructor and Description |
|---|
SVNRunnable(org.tmatesoft.svn.core.wc.SVNClientManager svnClientMgr,
org.tmatesoft.svn.core.SVNURL repositoryUrl,
File workingCopy,
long workingRevision)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
protected void |
checkoutOrUpdate()
Checks out the resource specified by the
remoteRepository in to the working copy
workingCopyDirectory. |
private org.tmatesoft.svn.core.wc.SVNRevision |
checkoutResourceDirectory()
Fetches the content from the SVN repository and creates the local working copy.
|
protected void |
checkWorkingCopyDirectory(File directory)
Checks that the given file exists, or can be created, is a directory, and is read/writable by this process.
|
protected String |
getProtocol()
Helper function to generate the full path for injecting into URLs and URIs.
|
void |
run() |
void |
setBeanName(String name) |
private void |
updateResourceDirectory()
Updates an existing local working copy from the repository.
|
private boolean |
workingCopyDirectoryExists()
Checks to see if the working copy directory exists.
|
doInitialize, getId, setIdprivate final Logger log
@Nonnull private final org.tmatesoft.svn.core.wc.SVNClientManager clientManager
@Nonnull private org.tmatesoft.svn.core.SVNURL remoteRepository
@Nonnull private File workingCopyDirectory
private org.tmatesoft.svn.core.wc.SVNRevision retrievalRevision
public SVNRunnable(@Nonnull@ParameterName(name="svnClientMgr") org.tmatesoft.svn.core.wc.SVNClientManager svnClientMgr, @Nonnull@ParameterName(name="repositoryUrl") org.tmatesoft.svn.core.SVNURL repositoryUrl, @Nonnull@ParameterName(name="workingCopy") File workingCopy, @ParameterName(name="workingRevision") long workingRevision)
svnClientMgr - manager used to create SVN clientsrepositoryUrl - URL of the remote repositoryworkingCopy - directory that will serve as the root of the local working copyworkingRevision - revision of the resource to retrieve or -1 for HEAD revisionorg.springframework.beans.factory.BeanCreationException - thrown if there is a problem initializing the SVN resourceprotected String getProtocol()
protected void checkWorkingCopyDirectory(@Nonnull File directory) throws IOException
directory - the directory to checkIOException - thrown if the file is invalidprotected void checkoutOrUpdate()
throws IOException
remoteRepository in to the working copy
workingCopyDirectory. If the working copy is empty than an SVN checkout is performed if the working copy
already exists then an SVN update is performed.IOException - thrown if there is a problem communicating with the remote repository, the revision does not
exist, or the working copy is unusableprivate boolean workingCopyDirectoryExists()
private org.tmatesoft.svn.core.wc.SVNRevision checkoutResourceDirectory()
throws IOException
IOException - thrown if there is a problem checking out the content from the repositoryprivate void updateResourceDirectory()
throws IOException
IOException - thrown if there is a problem updating the working copypublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic void setBeanName(String name)
setBeanName in interface org.springframework.beans.factory.BeanNameAwareCopyright © 1999–2020 Shibboleth Consortium. All rights reserved.