|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensaml.util.resource.AbstractFilteredResource
edu.internet2.middleware.shibboleth.common.resource.SVNResource
public class SVNResource
A resource representing a file fetch from a Subversion server. This resource will fetch the given resource as follows:
SVNResource
operating on the same local copy are undefined.
Nested Class Summary | |
---|---|
private class |
SVNResource.SVNStatusHandler
Simple ISVNStatusHandler implementation that just stores and returns the status. |
Field Summary | |
---|---|
private org.tmatesoft.svn.core.wc.SVNClientManager |
clientManager
SVN Client manager. |
private org.joda.time.DateTime |
lastModified
Time the resource file was last modified. |
private org.slf4j.Logger |
log
Class logger. |
private org.tmatesoft.svn.core.SVNURL |
remoteRepository
URL to the remote repository. |
private String |
resourceFileName
File, within the working copy, represented by this resource. |
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 Summary | |
---|---|
SVNResource(org.tmatesoft.svn.core.wc.SVNClientManager svnClientMgr,
org.tmatesoft.svn.core.SVNURL repositoryUrl,
File workingCopy,
long workingRevision,
String resourceFile)
Constructor. |
Method Summary | |
---|---|
protected void |
checkoutOrUpdateResource()
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. |
boolean |
exists()
|
InputStream |
getInputStream()
|
private org.joda.time.DateTime |
getLastModificationForRevision(org.tmatesoft.svn.core.wc.SVNRevision revision)
Gets the last modified time for the given revision. |
org.joda.time.DateTime |
getLastModifiedTime()
|
String |
getLocation()
|
protected File |
getResourceFile()
Gets File for the resource. |
private org.tmatesoft.svn.core.wc.SVNRevision |
updateResourceDirectory()
Updates an existing local working copy from the repository. |
private boolean |
workingCopyDirectoryExists()
Checks to see if the working copy directory exists. |
Methods inherited from class org.opensaml.util.resource.AbstractFilteredResource |
---|
applyFilter, getResourceFilter, setResourceFilter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final org.slf4j.Logger log
private final org.tmatesoft.svn.core.wc.SVNClientManager clientManager
private org.tmatesoft.svn.core.SVNURL remoteRepository
private File workingCopyDirectory
private org.tmatesoft.svn.core.wc.SVNRevision retrievalRevision
private String resourceFileName
private org.joda.time.DateTime lastModified
Constructor Detail |
---|
public SVNResource(org.tmatesoft.svn.core.wc.SVNClientManager svnClientMgr, org.tmatesoft.svn.core.SVNURL repositoryUrl, File workingCopy, long workingRevision, String resourceFile) throws org.opensaml.util.resource.ResourceException
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 resource
org.opensaml.util.resource.ResourceException
- thrown if there is a problem initializing the SVN resourceMethod Detail |
---|
public boolean exists() throws org.opensaml.util.resource.ResourceException
org.opensaml.util.resource.ResourceException
public InputStream getInputStream() throws org.opensaml.util.resource.ResourceException
org.opensaml.util.resource.ResourceException
public org.joda.time.DateTime getLastModifiedTime() throws org.opensaml.util.resource.ResourceException
org.opensaml.util.resource.ResourceException
public String getLocation()
protected File getResourceFile() throws org.opensaml.util.resource.ResourceException
File
for the resource.
org.opensaml.util.resource.ResourceException
- thrown if there is a problem fetching the resource or checking on its statusprotected void checkWorkingCopyDirectory(File directory) throws org.opensaml.util.resource.ResourceException
directory
- the directory to check
org.opensaml.util.resource.ResourceException
- thrown if the file is invalidprotected void checkoutOrUpdateResource() throws org.opensaml.util.resource.ResourceException
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.
org.opensaml.util.resource.ResourceException
- 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 org.opensaml.util.resource.ResourceException
org.opensaml.util.resource.ResourceException
- thrown if there is a problem checking out the content from the repositoryprivate org.tmatesoft.svn.core.wc.SVNRevision updateResourceDirectory() throws org.opensaml.util.resource.ResourceException
org.opensaml.util.resource.ResourceException
- thrown if there is a problem updating the working copyprivate org.joda.time.DateTime getLastModificationForRevision(org.tmatesoft.svn.core.wc.SVNRevision revision) throws org.opensaml.util.resource.ResourceException
revision
- revision to get the last modified date for
org.opensaml.util.resource.ResourceException
- thrown if there is a problem getting the last modified time
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |