public class SVNResource extends AbstractFilteredResource
SVNResource
operating on the same local copy are undefined.Modifier and Type | Class and Description |
---|---|
private class |
SVNResource.SVNStatusHandler
Simple
ISVNStatusHandler implementation that just stores and returns the status. |
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
SVNResource(org.tmatesoft.svn.core.wc.SVNClientManager svnClientMgr,
org.tmatesoft.svn.core.SVNURL repositoryUrl,
File workingCopy,
long workingRevision,
String resourceFile)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
applyFilter, getResourceFilter, setResourceFilter
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
public SVNResource(org.tmatesoft.svn.core.wc.SVNClientManager svnClientMgr, org.tmatesoft.svn.core.SVNURL repositoryUrl, File workingCopy, long workingRevision, String resourceFile) throws 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 resourceResourceException
- thrown if there is a problem initializing the SVN resourcepublic boolean exists() throws ResourceException
ResourceException
public InputStream getInputStream() throws ResourceException
ResourceException
public org.joda.time.DateTime getLastModifiedTime() throws ResourceException
ResourceException
public String getLocation()
protected File getResourceFile() throws ResourceException
File
for the resource.ResourceException
- thrown if there is a problem fetching the resource or checking on its statusprotected void checkWorkingCopyDirectory(File directory) throws ResourceException
directory
- the directory to checkResourceException
- thrown if the file is invalidprotected void checkoutOrUpdateResource() throws 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.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 ResourceException
ResourceException
- thrown if there is a problem checking out the content from the repositoryprivate org.tmatesoft.svn.core.wc.SVNRevision updateResourceDirectory() throws ResourceException
ResourceException
- thrown if there is a problem updating the working copyprivate org.joda.time.DateTime getLastModificationForRevision(org.tmatesoft.svn.core.wc.SVNRevision revision) throws ResourceException
revision
- revision to get the last modified date forResourceException
- thrown if there is a problem getting the last modified timeCopyright © 1999-2012. All Rights Reserved.