@Deprecated public class SVNResource extends AbstractIdentifiedInitializableComponent implements org.springframework.core.io.Resource, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, Resource
Resource that communications with a Subversion server (via a spool directory).
This resource will fetch the given resource as follows:
SVNResource operating on the same local copy are undefined.| Modifier and Type | Class and Description |
|---|---|
private class |
SVNResource.SVNStatusHandler
Deprecated.
Simple
ISVNStatusHandler implementation that just stores and returns the status. |
| Modifier and Type | Field and Description |
|---|---|
private org.tmatesoft.svn.core.wc.SVNClientManager |
clientManager
Deprecated.
SVN Client manager.
|
private org.joda.time.DateTime |
lastModified
Deprecated.
Time the resource file was last modified.
|
private org.slf4j.Logger |
log
Deprecated.
Class logger.
|
private org.tmatesoft.svn.core.SVNURL |
remoteRepository
Deprecated.
URL to the remote repository.
|
private String |
resourceFileName
Deprecated.
File, within the working copy, represented by this resource.
|
private org.tmatesoft.svn.core.wc.SVNRevision |
retrievalRevision
Deprecated.
Revision of the working copy.
|
private File |
workingCopyDirectory
Deprecated.
Directory where the working copy will be kept.
|
| Constructor and Description |
|---|
SVNResource(org.tmatesoft.svn.core.wc.SVNClientManager svnClientMgr,
org.tmatesoft.svn.core.SVNURL repositoryUrl,
File workingCopy,
long workingRevision,
String resourceFile)
Deprecated.
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
Deprecated.
|
protected void |
checkoutOrUpdateResource()
Deprecated.
Checks out the resource specified by the
remoteRepository in to the working copy
workingCopyDirectory. |
private org.tmatesoft.svn.core.wc.SVNRevision |
checkoutResourceDirectory()
Deprecated.
Fetches the content from the SVN repository and creates the local working copy.
|
protected void |
checkWorkingCopyDirectory(File directory)
Deprecated.
Checks that the given file exists, or can be created, is a directory, and is read/writable by this process.
|
long |
contentLength()
Deprecated.
|
org.springframework.core.io.Resource |
createRelative(String relativePath)
Deprecated.
|
Resource |
createRelativeResource(String relativePath)
Deprecated.
|
boolean |
exists()
Deprecated.
|
String |
getDescription()
Deprecated.
|
File |
getFile()
Deprecated.
|
String |
getFilename()
Deprecated.
|
protected String |
getFullPath()
Deprecated.
Helper function to generate the full path for injecting into URLs and URIs.
|
InputStream |
getInputStream()
Deprecated.
|
private org.joda.time.DateTime |
getLastModificationForRevision(org.tmatesoft.svn.core.wc.SVNRevision revision)
Deprecated.
Gets the last modified time for the given revision.
|
protected String |
getProtocol()
Deprecated.
Helper function to return a complex scheme - a conjunction of 'svn' and the underlying protocol.
|
URI |
getURI()
Deprecated.
|
URL |
getURL()
Deprecated.
|
boolean |
isOpen()
Deprecated.
Our stream can be read multiple times.
|
boolean |
isReadable()
Deprecated.
We always say yes.
|
long |
lastModified()
Deprecated.
|
void |
setBeanName(String name)
Deprecated.
|
void |
setFilename(String fileName)
Deprecated.
Set the resourceFileName.
|
private org.tmatesoft.svn.core.wc.SVNRevision |
updateResourceDirectory()
Deprecated.
Updates an existing local working copy from the repository.
|
private boolean |
workingCopyDirectoryExists()
Deprecated.
Checks to see if the working copy directory exists.
|
doInitialize, getId, setIddestroy, doDestroy, initialize, isDestroyed, isInitializedprivate final org.slf4j.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
private String resourceFileName
private org.joda.time.DateTime lastModified
public SVNResource(@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, @Nonnull @ParameterName(name="resourceFile") String resourceFile)
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 revisionresourceFile - file, within the working copy, represented by this resourceorg.springframework.beans.factory.BeanCreationException - thrown if there is a problem initializing the SVN resourcepublic String getFilename()
getFilename in interface Resourcepublic void setFilename(@Nonnull String fileName)
fileName - the nameprotected String getFullPath()
protected String getProtocol()
protected void checkWorkingCopyDirectory(@Nonnull File directory) throws IOException
directory - the directory to checkIOException - thrown if the file is invalidprotected void checkoutOrUpdateResource()
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 org.joda.time.DateTime getLastModificationForRevision(org.tmatesoft.svn.core.wc.SVNRevision revision)
throws IOException
revision - revision to get the last modified date forIOException - thrown if there is a problem getting the last modified timeprivate org.tmatesoft.svn.core.wc.SVNRevision updateResourceDirectory()
throws IOException
IOException - thrown if there is a problem updating the working copypublic InputStream getInputStream() throws IOException
getInputStream in interface ResourcegetInputStream in interface org.springframework.core.io.InputStreamSourceIOExceptionpublic boolean isReadable()
isReadable in interface Resourcepublic boolean isOpen()
public URL getURL() throws IOException
getURL in interface ResourceIOExceptionpublic URI getURI() throws IOException
getURI in interface ResourceIOExceptionpublic File getFile() throws IOException
getFile in interface ResourceIOExceptionpublic long contentLength()
throws IOException
contentLength in interface ResourceIOExceptionpublic long lastModified()
throws IOException
lastModified in interface ResourceIOExceptionpublic org.springframework.core.io.Resource createRelative(String relativePath) throws IOException
IOExceptionpublic Resource createRelativeResource(String relativePath) throws IOException
createRelativeResource in interface ResourceIOExceptionpublic String getDescription()
getDescription in interface Resourcepublic 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–2019 Shibboleth Consortium. All rights reserved.