public class SvnSession extends java.lang.Object implements org.magicwerk.brownies.core.files.filemodel.ISession, ISvnSession
| Constructor and Description |
|---|
SvnSession(java.lang.String url,
java.lang.String username,
java.lang.String password)
Connect to a SVN repository.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close connection to SVN repository.
|
long |
getDefaultRevision() |
SvnDirectory |
getDirectory(java.lang.String path)
Return ISvnDir reference to requested directory in revision head.
|
SvnDirectory |
getDirectory(java.lang.String path,
long revision)
Return SvnDir reference to requested directory.
|
static SvnDirectory |
getDirectory(java.lang.String url,
java.lang.String username,
java.lang.String password)
Connect to a SVN repository and gets stored directory.
|
SvnEntry |
getEntry(java.lang.String path)
Return ISvnEntry reference to requested file in revision head.
|
SvnEntry |
getEntry(java.lang.String path,
long revision)
Return ISvnEntry reference to requested entry.
|
SvnEntry |
getEntry(java.lang.String path,
long revision,
org.magicwerk.brownies.core.files.filemodel.IEntry.Type type) |
SvnFile |
getFile(java.lang.String path)
Return ISvnFile reference to requested file in revision head.
|
SvnFile |
getFile(java.lang.String path,
long revision)
Return SvnFile reference to requested file.
|
static SvnFile |
getFile(java.lang.String url,
java.lang.String username,
java.lang.String password,
long revision)
Connect to a SVN repository and gets stored file.
|
long |
getHeadRevision()
Gets the head revision number of the repository
|
java.util.List<LogEntry> |
getLogEntries(long startRev,
long endRev) |
java.util.List<LogEntry> |
getLogEntries(long startRev,
long endRev,
java.lang.String path) |
LogEntry |
getLogEntry(long rev) |
LogEntry |
getLogEntry(long rev,
java.lang.String path) |
java.lang.String |
getPassword() |
org.tmatesoft.svn.core.io.SVNRepository |
getRepository()
Returns object for direct access to SVNRepository of SVNKit
|
java.lang.String |
getRepositoryRoot() |
SvnDirectory |
getRoot() |
SvnDirectory |
getRoot(long revision) |
org.magicwerk.brownies.core.files.filemodel.IEntry.Type |
getType(java.lang.String path) |
org.magicwerk.brownies.core.files.filemodel.IEntry.Type |
getType(java.lang.String path,
long revision)
Returns type of entry with given path and revision.
|
java.lang.String |
getUsername() |
boolean |
isDirectory(java.lang.String path) |
boolean |
isDirectory(java.lang.String path,
long revision)
Checks whether the given directory exists.
|
boolean |
isFile(java.lang.String path) |
boolean |
isFile(java.lang.String path,
long revision)
Checks whether the given file exists.
|
void |
setDefaultRevision(long defaultRevision) |
public SvnSession(java.lang.String url,
java.lang.String username,
java.lang.String password)
url - URL of repository (this can be the full path
referencing an item under SVN control)username - username to connectpassword - password to connectjava.lang.RuntimeException - if connect failspublic void close()
public java.lang.String getUsername()
public java.lang.String getPassword()
public static SvnDirectory getDirectory(java.lang.String url, java.lang.String username, java.lang.String password)
url - URL of directory in repositoryusername - username to connectpassword - password to connectjava.lang.RuntimeException - if connect failspublic static SvnFile getFile(java.lang.String url, java.lang.String username, java.lang.String password, long revision)
url - URL of file in repositoryusername - username to connectpassword - password to connectrevision - revision to retrieve (-1 for HEAD)java.lang.RuntimeException - if connect failspublic long getDefaultRevision()
public void setDefaultRevision(long defaultRevision)
defaultRevision - the default revision to setpublic org.tmatesoft.svn.core.io.SVNRepository getRepository()
public java.lang.String getRepositoryRoot()
getRepositoryRoot in interface ISvnSessionpublic long getHeadRevision()
ISvnSessiongetHeadRevision in interface ISvnSessionpublic SvnFile getFile(java.lang.String path)
ISvnSessiongetFile in interface org.magicwerk.brownies.core.files.filemodel.ISessiongetFile in interface ISvnSessionpath - path to fileISvnSession.getFile(String, long)public SvnDirectory getDirectory(java.lang.String path)
ISvnSessiongetDirectory in interface org.magicwerk.brownies.core.files.filemodel.ISessiongetDirectory in interface ISvnSessionpath - path to directoryISvnSession.getFile(String, long)public boolean isDirectory(java.lang.String path)
public boolean isFile(java.lang.String path)
public boolean isDirectory(java.lang.String path,
long revision)
path - path of directoryrevision - revision of directory (use -1 for head revision)java.lang.RuntimeException - if a SVN error occurspublic boolean isFile(java.lang.String path,
long revision)
path - path of filerevision - revision of file (use -1 for head revision)java.lang.RuntimeException - if a SVN error occurspublic SvnDirectory getRoot()
getRoot in interface org.magicwerk.brownies.core.files.filemodel.ISessiongetRoot in interface ISvnSessionpublic SvnDirectory getRoot(long revision)
getRoot in interface ISvnSessionpublic org.magicwerk.brownies.core.files.filemodel.IEntry.Type getType(java.lang.String path)
getType in interface org.magicwerk.brownies.core.files.filemodel.ISessionpublic org.magicwerk.brownies.core.files.filemodel.IEntry.Type getType(java.lang.String path,
long revision)
ISvnSessiongetType in interface ISvnSessionpath - path to entryrevision - revision number (use -1 for head revision)public SvnEntry getEntry(java.lang.String path)
ISvnSessiongetEntry in interface org.magicwerk.brownies.core.files.filemodel.ISessiongetEntry in interface ISvnSessionpath - path to entryISvnSession.getEntry(String, long)public SvnEntry getEntry(java.lang.String path, long revision)
ISvnSessiongetEntry in interface ISvnSessionpath - path to entryrevision - revision number (use -1 for head revision)public SvnEntry getEntry(java.lang.String path, long revision, org.magicwerk.brownies.core.files.filemodel.IEntry.Type type)
public SvnFile getFile(java.lang.String path, long revision)
getFile in interface ISvnSessionpath - Path to filerevision - revision number (use -1 for head revision)java.lang.RuntimeException - if no file entry is foundpublic SvnDirectory getDirectory(java.lang.String path, long revision)
getDirectory in interface ISvnSessionpath - path to directoryrevision - revision number (use -1 for head revision)java.lang.RuntimeException - if no directory entry is foundpublic LogEntry getLogEntry(long rev)
public LogEntry getLogEntry(long rev, java.lang.String path)
public java.util.List<LogEntry> getLogEntries(long startRev, long endRev)
public java.util.List<LogEntry> getLogEntries(long startRev, long endRev, java.lang.String path)