Package com.zfabrik.impl.svnaccess
Class SVNKitSvnRepository
- java.lang.Object
-
- com.zfabrik.impl.svnaccess.SVNKitSvnRepository
-
- All Implemented Interfaces:
com.zfabrik.svnaccess.ISvnRepository,java.io.Closeable,java.lang.AutoCloseable
public class SVNKitSvnRepository extends java.lang.Object implements com.zfabrik.svnaccess.ISvnRepositorySVNKit based implementation of our Svn Repo abstraction. Requires to have SVNKit on the classpath to load and work. This implementation will be picked bySvnClientAdapterResourceif an SVNKit library of version 1.7.9 or higher is found - as far as compatibility of SVNKit is established with that version.
-
-
Constructor Summary
Constructors Constructor Description SVNKitSvnRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidexport(java.lang.String path, long pegRevision, java.io.File targetDir)Exports the given directory content to the given target directory.java.lang.StringgetBaseUrl()voidgetContent(java.lang.String path, long pegRevision, long revision, com.zfabrik.svnaccess.IStreamHandler streamHandler)Retrieves the content of the given SVN URL and calls the given stream handler for the input streamjava.lang.StringgetCRPath()longgetCurrentCRRevision()java.lang.StringgetRepositoryUuid()java.lang.StringgetSvnRootUrl()com.zfabrik.svnaccess.SvnInfoinfo()returns details about the base path at HEAD revisioncom.zfabrik.svnaccess.SvnInfoinfo(java.lang.String path, long pegRevision)returns details about a single pathintlist(java.lang.String path, long pegRevision, long revision, com.zfabrik.svnaccess.IDirEntryHandler dirEntryHandler)Retrieves all direct children for the given SVN URL and calls the given resource handler for each childintlog(java.lang.String path, long pegRevision, long revisionFrom, long revisionTo, com.zfabrik.svnaccess.ISvnLogEntryHandler logEntryHandler)Retrieves all changes for the given SVN URL and the given revision range and calls the given log entry handler for each change.voidsetBaseUrl(java.lang.String baseUrl)Sets the base URL - this is the z2 component repository URLvoidsetPassword(java.lang.String password)Sets the password (like --password)voidsetUsername(java.lang.String username)Sets the username (like --username)
-
-
-
Method Detail
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
getBaseUrl
public java.lang.String getBaseUrl()
- Specified by:
getBaseUrlin interfacecom.zfabrik.svnaccess.ISvnRepository- Returns:
- the repository base URL
-
setBaseUrl
public void setBaseUrl(java.lang.String baseUrl)
Description copied from interface:com.zfabrik.svnaccess.ISvnRepositorySets the base URL - this is the z2 component repository URL- Specified by:
setBaseUrlin interfacecom.zfabrik.svnaccess.ISvnRepository- Parameters:
baseUrl- base URL
-
setUsername
public void setUsername(java.lang.String username)
Description copied from interface:com.zfabrik.svnaccess.ISvnRepositorySets the username (like --username)- Specified by:
setUsernamein interfacecom.zfabrik.svnaccess.ISvnRepository- Parameters:
username- svn user
-
setPassword
public void setPassword(java.lang.String password)
Description copied from interface:com.zfabrik.svnaccess.ISvnRepositorySets the password (like --password)- Specified by:
setPasswordin interfacecom.zfabrik.svnaccess.ISvnRepository- Parameters:
password- svn password
-
getRepositoryUuid
public java.lang.String getRepositoryUuid() throws java.io.IOException- Specified by:
getRepositoryUuidin interfacecom.zfabrik.svnaccess.ISvnRepository- Returns:
- repository UUID
- Throws:
java.io.IOException
-
getCurrentCRRevision
public long getCurrentCRRevision() throws java.io.IOException- Specified by:
getCurrentCRRevisionin interfacecom.zfabrik.svnaccess.ISvnRepository- Returns:
- current SVNCR revision
- Throws:
java.io.IOException
-
getSvnRootUrl
public java.lang.String getSvnRootUrl() throws java.io.IOException- Specified by:
getSvnRootUrlin interfacecom.zfabrik.svnaccess.ISvnRepository- Returns:
- SVN-Repository root URL - e.g. "http://z2-environment.net/svn/z2-environment/"
- Throws:
java.io.IOException
-
getCRPath
public java.lang.String getCRPath() throws java.io.IOException- Specified by:
getCRPathin interfacecom.zfabrik.svnaccess.ISvnRepository- Returns:
- CR-path relative to SVN root URL - e.g. "/trunk/z2-base.base"
- Throws:
java.io.IOException
-
info
public com.zfabrik.svnaccess.SvnInfo info(java.lang.String path, long pegRevision) throws java.io.IOExceptionDescription copied from interface:com.zfabrik.svnaccess.ISvnRepositoryreturns details about a single path- Specified by:
infoin interfacecom.zfabrik.svnaccess.ISvnRepository- Parameters:
path- path relative to the component repositorypegRevision- peg revision, use -1 for HEAD- Returns:
- an
SvnDirEntrycontaining the details or null if the given path does not exist in the given revision - Throws:
java.io.IOException
-
info
public com.zfabrik.svnaccess.SvnInfo info() throws java.io.IOExceptionDescription copied from interface:com.zfabrik.svnaccess.ISvnRepositoryreturns details about the base path at HEAD revision- Specified by:
infoin interfacecom.zfabrik.svnaccess.ISvnRepository- Returns:
- most current info of the base-path
- Throws:
java.io.IOException
-
log
public int log(java.lang.String path, long pegRevision, long revisionFrom, long revisionTo, com.zfabrik.svnaccess.ISvnLogEntryHandler logEntryHandler) throws java.io.IOExceptionDescription copied from interface:com.zfabrik.svnaccess.ISvnRepositoryRetrieves all changes for the given SVN URL and the given revision range and calls the given log entry handler for each change. If revisionFrom is greater than revisionTo the revision order is descending, otherwise it's ascending.- Specified by:
login interfacecom.zfabrik.svnaccess.ISvnRepository- Parameters:
path- path relative to CR-rootpegRevision- peg revision, use -1 for HEADrevisionFrom- revision fromrevisionTo- revision tologEntryHandler- log entry handler is called for each changed resource- Returns:
- number of log entries
- Throws:
java.io.IOException- if SVN LOG fails
-
list
public int list(java.lang.String path, long pegRevision, long revision, com.zfabrik.svnaccess.IDirEntryHandler dirEntryHandler) throws java.io.IOExceptionDescription copied from interface:com.zfabrik.svnaccess.ISvnRepositoryRetrieves all direct children for the given SVN URL and calls the given resource handler for each child- Specified by:
listin interfacecom.zfabrik.svnaccess.ISvnRepository- Parameters:
path- path relative to CR-rootpegRevision- peg revision, use -1 for HEADrevision- revision, use -1 for HEADdirEntryHandler- resource handler- Returns:
- number of dir entries
- Throws:
java.io.IOException- if SVN URL does not exist in the given revision
-
getContent
public void getContent(java.lang.String path, long pegRevision, long revision, com.zfabrik.svnaccess.IStreamHandler streamHandler) throws java.io.IOExceptionDescription copied from interface:com.zfabrik.svnaccess.ISvnRepositoryRetrieves the content of the given SVN URL and calls the given stream handler for the input stream- Specified by:
getContentin interfacecom.zfabrik.svnaccess.ISvnRepository- Parameters:
path- path relative to component repository URLpegRevision- peg revision, use -1 for HEADrevision- revisionstreamHandler- stream handler- Throws:
java.io.IOException- if SVN URL does not exist in the given revision
-
export
public void export(java.lang.String path, long pegRevision, java.io.File targetDir) throws java.io.IOExceptionDescription copied from interface:com.zfabrik.svnaccess.ISvnRepositoryExports the given directory content to the given target directory. The directory will be overridden if it exists already!- Specified by:
exportin interfacecom.zfabrik.svnaccess.ISvnRepository- Parameters:
path- path relative to component repository URLpegRevision- revision, use -1 for HEAD (we always use preg revision HEAD)targetDir- target directory- Throws:
java.io.IOException- if SVN URL does not exist in the given revision or targetDir refers to an existing file
-
-