edu.internet2.middleware.shibboleth.common.resource
Class SVNResource

java.lang.Object
  extended by org.opensaml.util.resource.AbstractFilteredResource
      extended by edu.internet2.middleware.shibboleth.common.resource.SVNResource
All Implemented Interfaces:
org.opensaml.util.resource.Resource

public class SVNResource
extends org.opensaml.util.resource.AbstractFilteredResource

A resource representing a file fetch from a Subversion server. This resource will fetch the given resource as follows:

All operations operate on the local working copy.

Since:
1.1

Constructor Summary
SVNResource(org.tmatesoft.svn.core.wc.SVNClientManager svnClientMgr, org.tmatesoft.svn.core.SVNURL repositoryUrl, File workingCopyDirectory, long revision, String resourceFile)
          Constructor.
 
Method Summary
protected  void checkoutOrUpdateResource()
          Checks out the resource specified by the remoteRepository in to the working copy workingCopy.
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()
          
 DateTime getLastModifiedTime()
          
 String getLocation()
          
protected  File getResourceFile()
          Gets File for the resource.
 
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
 

Constructor Detail

SVNResource

public SVNResource(org.tmatesoft.svn.core.wc.SVNClientManager svnClientMgr,
                   org.tmatesoft.svn.core.SVNURL repositoryUrl,
                   File workingCopyDirectory,
                   long revision,
                   String resourceFile)
            throws org.opensaml.util.resource.ResourceException
Constructor.

Parameters:
svnClientMgr - manager used to create SVN clients
repositoryUrl - URL of the remote repository
workingCopyDirectory - directory that will serve as the root of the local working copy
revision - revision of the resource to retrieve or -1 for HEAD revision
resourceFile - file, within the working copy, represented by this resource
Throws:
org.opensaml.util.resource.ResourceException
Method Detail

exists

public boolean exists()
               throws org.opensaml.util.resource.ResourceException

Throws:
org.opensaml.util.resource.ResourceException

getInputStream

public InputStream getInputStream()
                           throws org.opensaml.util.resource.ResourceException

Throws:
org.opensaml.util.resource.ResourceException

getLastModifiedTime

public DateTime getLastModifiedTime()
                             throws org.opensaml.util.resource.ResourceException

Throws:
org.opensaml.util.resource.ResourceException

getLocation

public String getLocation()


checkWorkingCopyDirectory

protected void checkWorkingCopyDirectory(File directory)
                                  throws org.opensaml.util.resource.ResourceException
Checks that the given file exists, or can be created, is a directory, and is read/writable by this process.

Parameters:
directory - the directory to check
Throws:
org.opensaml.util.resource.ResourceException - thrown if the file is invalid

checkoutOrUpdateResource

protected void checkoutOrUpdateResource()
                                 throws org.opensaml.util.resource.ResourceException
Checks out the resource specified by the remoteRepository in to the working copy workingCopy. If the working copy is empty than an SVN checkout is performed if the working copy already exists then an SVN update is performed.

Throws:
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 unusable

getResourceFile

protected File getResourceFile()
Gets File for the resource.

Returns:
file for the resource


Copyright © 2006-2010 Internet2. All Rights Reserved.