Package com.zfabrik.impl.svnaccess
Class JavaHLSvnRepository
- java.lang.Object
-
- com.zfabrik.impl.svnaccess.JavaHLSvnRepository
-
- All Implemented Interfaces:
com.zfabrik.svnaccess.ISvnRepository
,java.io.Closeable
,java.lang.AutoCloseable
public class JavaHLSvnRepository extends java.lang.Object implements com.zfabrik.svnaccess.ISvnRepository
Implementation ofISvnRepository
over JavaHL. This class depends on the JavaHL API and may not be loaded unless that is present. A word on paths:- In CR paths don't have leading slashes
- Repo URLs never have trailing slashes
-
-
Constructor Summary
Constructors Constructor Description JavaHLSvnRepository()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the client instancevoid
export(java.lang.String path, long revision, java.io.File targetDir)
Export relative to CRjava.lang.String
getBaseUrl()
void
getContent(java.lang.String path, long pegRevision, long revision, com.zfabrik.svnaccess.IStreamHandler streamHandler)
Retrieve relative to CRjava.lang.String
getCRPath()
long
getCurrentCRRevision()
java.lang.String
getRepositoryUuid()
java.lang.String
getSvnRootUrl()
com.zfabrik.svnaccess.SvnInfo
info()
returns details about the base path at HEAD revisioncom.zfabrik.svnaccess.SvnInfo
info(java.lang.String path, long pegRevision)
Info on path in CRint
list(java.lang.String path, long pegRevision, long revision, com.zfabrik.svnaccess.IDirEntryHandler dirEntryHandler)
List relative to CRint
log(java.lang.String path, long revision, long revisionFrom, long revisionTo, com.zfabrik.svnaccess.ISvnLogEntryHandler logEntryHandler)
Log on path in CRstatic void
main(java.lang.String[] args)
void
setBaseUrl(java.lang.String baseUrl)
Sets the base URL - this is the z2 component repository URLvoid
setPassword(java.lang.String password)
Sets the password (like --password)void
setUsername(java.lang.String username)
Sets the username (like --username)java.lang.String
toString()
-
-
-
Method Detail
-
getBaseUrl
public java.lang.String getBaseUrl()
- Specified by:
getBaseUrl
in interfacecom.zfabrik.svnaccess.ISvnRepository
- Returns:
- the repository base URL
-
setBaseUrl
public void setBaseUrl(java.lang.String baseUrl)
Description copied from interface:com.zfabrik.svnaccess.ISvnRepository
Sets the base URL - this is the z2 component repository URL- Specified by:
setBaseUrl
in interfacecom.zfabrik.svnaccess.ISvnRepository
- Parameters:
baseUrl
- base URL
-
setUsername
public void setUsername(java.lang.String username)
Description copied from interface:com.zfabrik.svnaccess.ISvnRepository
Sets the username (like --username)- Specified by:
setUsername
in interfacecom.zfabrik.svnaccess.ISvnRepository
- Parameters:
username
- svn user
-
setPassword
public void setPassword(java.lang.String password)
Description copied from interface:com.zfabrik.svnaccess.ISvnRepository
Sets the password (like --password)- Specified by:
setPassword
in interfacecom.zfabrik.svnaccess.ISvnRepository
- Parameters:
password
- svn password
-
getRepositoryUuid
public java.lang.String getRepositoryUuid() throws java.io.IOException
- Specified by:
getRepositoryUuid
in interfacecom.zfabrik.svnaccess.ISvnRepository
- Returns:
- repository UUID
- Throws:
java.io.IOException
-
getCurrentCRRevision
public long getCurrentCRRevision() throws java.io.IOException
- Specified by:
getCurrentCRRevision
in interfacecom.zfabrik.svnaccess.ISvnRepository
- Returns:
- current SVNCR revision
- Throws:
java.io.IOException
-
getSvnRootUrl
public java.lang.String getSvnRootUrl() throws java.io.IOException
- Specified by:
getSvnRootUrl
in 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:
getCRPath
in 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.IOException
Info on path in CR- Specified by:
info
in interfacecom.zfabrik.svnaccess.ISvnRepository
- Parameters:
path
- path relative to the component repositorypegRevision
- peg revision, use -1 for HEAD- Returns:
- an
SvnDirEntry
containing 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.IOException
Description copied from interface:com.zfabrik.svnaccess.ISvnRepository
returns details about the base path at HEAD revision- Specified by:
info
in 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 revision, long revisionFrom, long revisionTo, com.zfabrik.svnaccess.ISvnLogEntryHandler logEntryHandler) throws java.io.IOException
Log on path in CR- Specified by:
log
in interfacecom.zfabrik.svnaccess.ISvnRepository
- Parameters:
path
- path relative to CR-rootrevision
- 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.IOException
List relative to CR- Specified by:
list
in 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.IOException
Retrieve relative to CR- Specified by:
getContent
in 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 revision, java.io.File targetDir) throws java.io.IOException
Export relative to CR- Specified by:
export
in interfacecom.zfabrik.svnaccess.ISvnRepository
- Parameters:
path
- path relative to component repository URLrevision
- 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
-
close
public void close() throws java.io.IOException
Close the client instance- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-