public class AstroVersion extends Object
Modifier and Type | Class and Description |
---|---|
private class |
AstroVersion.FileRevHandler
A event handler class to do somehting when the file revision events come in during
a getFileRevisions command.
|
private class |
AstroVersion.RevLogHandler
A event handler class to do somehting when the log events come in during
a log command.
|
Modifier and Type | Field and Description |
---|---|
(package private) SVNRepositoryLocation |
location_
Class holder for the currently used repo location object.
|
(package private) boolean |
repoIsInit_
Class flag keeping track if the repo has been setup for use.
|
(package private) SVNRepository |
repository_
Class holder for the currently used repo location object.
|
(package private) TreeMap |
revLogHashTree_
Class holder for file revision log information that needs to be shared
with internal private classes.
|
(package private) SVNURL |
svnURL_ |
(package private) ISVNWorkspace |
workspace_ |
Constructor and Description |
---|
AstroVersion() |
Modifier and Type | Method and Description |
---|---|
private String |
cat(String path,
long revNumber)
Internal helper method to do a cat on a repo file and return it as a
String.
|
private byte[] |
catBytes(String path,
long revNumber)
Internal helper method to do a cat on a repo file and return it as raw
bytes.
|
String |
encodeString(String bytes)
Provides basic URL encoding of a String.
|
byte[] |
getFileBytes(String repo,
String filePath,
String rev)
Retrieves the file from the repo and returns it as bytes.
|
String |
getFileContents(String repo,
String filePath,
String rev)
Retrieves the file from the repo and returns it as a String.
|
String |
getFileDiff(String repo,
String filePath,
String rev,
String rev2)
Retrieves the file from the repo and returns it as bytes.
|
byte[] |
getFileDiffBytes(String repo,
String filePath,
String rev,
String rev2)
Retrieves the file from the repo and returns it as bytes.
|
TreeMap |
getFileLogEntries(String repo,
String filePath)
Gets the file Log Entries for a file in a sorted TreeMap.
|
String |
getFileRevisionAuthor(SVNFileRevision rev)
Convienience method to get the fileRevision author for a file revision from the
SVNRevisionProperties.
|
String |
getFileRevisionDate(SVNFileRevision rev)
Convienience method to get the fileRevision date for a file revision from the
SVNRevisionProperties.
|
TreeMap |
getFileRevisionEntries(String repo,
String filePath)
Gets the fileRevisionEntries for a file in a sorted TreeMap and puts it in the class.
|
String |
getFileRevisionLog(SVNFileRevision rev)
Convienience method to get the fileRevision log for a file revision from the
SVNRevisionProperties.
|
static String |
getMimeType(String format)
This Method Returns the right MIME type for a particular format
|
String |
getRevisionPropertyValue(SVNFileRevision rev,
String propertyName)
Gets the fileRevision log for a file revision from the SVNRevisionProperty log.
|
String |
getSvnFileDiff(String repo,
String filePath,
String rev,
String rev2)
Retrieves the file from the repo and returns it as bytes.
|
void |
initRepo(String repository)
Setup the SVN Repository objects as required by the JavaSVN Library.
|
static void |
main(String[] args)
Main method to do a quick debug check.
|
SVNRepositoryLocation location_
SVNRepository repository_
ISVNWorkspace workspace_
SVNURL svnURL_
boolean repoIsInit_
TreeMap revLogHashTree_
public AstroVersion()
public void initRepo(String repository) throws SVNException
repository
- The String representation of the URL for the
repository to access.SVNException
- Thrown if issues with the spec'd repo.public String getFileContents(String repo, String filePath, String rev)
repo
- The repo to use for the retrievalfilePath
- The repo sub path (including the filename) to get the
file from.rev
- The revision number to retrieve.public byte[] getFileBytes(String repo, String filePath, String rev)
repo
- The repo to use for the retrievalfilePath
- The repo sub path (including the filename) to get the
file from.rev
- The revision number to retrieve.public byte[] getFileDiffBytes(String repo, String filePath, String rev, String rev2) throws IllegalArgumentException, ClientException
repo
- The repo to use for the retrievalfilePath
- The repo sub path (including the filename) to get the
file from.rev
- The revision number to retrieve.If
- one of the rev numbers is invalid (ie negative)IllegalArgumentException
ClientException
public String getFileDiff(String repo, String filePath, String rev, String rev2)
repo
- The repo to use for the retrievalfilePath
- The repo sub path (including the filename) to get the
file from.rev
- The revision number to retrieve.If
- one of the rev numbers is invalid (ie negative)public String getSvnFileDiff(String repo, String filePath, String rev, String rev2) throws IllegalArgumentException, ClientException
repo
- The repo to use for the retrievalfilePath
- The repo sub path (including the filename) to get the
file from.rev
- The revision number to retrieve.If
- one of the rev numbers is invalid (ie negative)IllegalArgumentException
ClientException
public String encodeString(String bytes)
bytes
- A String to do the conversion.public String getRevisionPropertyValue(SVNFileRevision rev, String propertyName) throws SVNException
rev
- the rev to get the log entry forSVNException
public String getFileRevisionLog(SVNFileRevision rev)
rev
- the rev to get the log entry forpublic String getFileRevisionDate(SVNFileRevision rev)
rev
- the rev to get the log entry forpublic String getFileRevisionAuthor(SVNFileRevision rev)
rev
- the rev to get the log entry forpublic TreeMap getFileRevisionEntries(String repo, String filePath)
repo
- the repo to queryfilePath
- the file to getpublic TreeMap getFileLogEntries(String repo, String filePath)
repo
- the repo to queryfilePath
- the file to getprivate String cat(String path, long revNumber) throws SVNException
path
- The file path to get the catrevNumber
- the rev to getSVNException
- Description of the Exceptionprivate byte[] catBytes(String path, long revNumber) throws SVNException
path
- Description of the ParameterrevNumber
- Description of the ParameterSVNException
- Description of the Exceptionpublic static String getMimeType(String format)
format
- Description of the ParameterWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses