public class RepositoryFileManager
extends java.lang.Object
| Constructor and Description |
|---|
RepositoryFileManager(java.lang.String pathName)
Creates a new instance with root at
pathName. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
absolutePathToUrl(java.lang.String absolute)
Converts an absolute path in the repository to a URL, using the
repository URL
|
java.lang.String |
absoluteToRelativePath(java.lang.String stringData)
Converts an absolute path in the repository to a path relative to the
working folder root.
|
void |
addDirectory(java.lang.String relativePath)
Adds a directory to the list of known directories.
|
boolean |
existsInWorkingCopy(java.lang.String relativePath)
Returns true if the file exists in the working copy (according to the svn
metadata, and not file system checks).
|
protected ISvnDiffProcessor |
getDiffProcessor() |
protected ISvnInfoProcessor |
getInfoProcessor() |
protected int |
getLineCount(java.io.BufferedReader reader)
Counts lines on a BufferedReader
|
int[] |
getLineDiff(java.lang.String oldRevNr,
java.lang.String newRevNr,
java.lang.String filename)
Returns line count differences between two revisions of a file.
|
int |
getLinesOfCode(java.lang.String filename)
Returns the lines of code for a repository file.
|
java.lang.String |
getModuleName()
Assumes #loadInfo(String) has been called.
|
ISvnProcessor |
getProcessor() |
protected ISvnPropgetProcessor |
getPropgetProcessor() |
java.lang.String |
getRepositoryUuid()
Assumes #loadInfo(String) has been called.
|
java.lang.String |
getRevision(java.lang.String filename)
Returns the revision of filename in the local working directory by
reading the svn metadata.
|
java.util.Vector |
getRevisionDiff(java.lang.String newRevNr)
Returns line count differences for all files in a particular revision.
|
java.lang.String |
getRootRevisionNumber()
Assumes #loadInfo(String) has been called.
|
protected ISvnVersionProcessor |
getVersionProcessor() |
boolean |
isBinary(java.lang.String relativePath)
Is the given path a binary file in the working directory?
|
boolean |
isDirectory(java.lang.String relativePath)
Returns true if the path has been identified as a directory.
|
void |
loadInfo()
Initializes our representation of the repository.
|
java.lang.String |
relativePathToUrl(java.lang.String relative)
Converts a relative path in the working folder to a URL, using the
working folder's root URL
|
java.lang.String |
relativeToAbsolutePath(java.lang.String relative)
Converts a relative path in the working folder to an absolute path in the
repository.
|
java.lang.String |
urlToAbsolutePath(java.lang.String url)
Converts a url to an absolute path in the repository.
|
java.lang.String |
urlToRelativePath(java.lang.String url)
Converts a url to a relative path in the repository.
|
public RepositoryFileManager(java.lang.String pathName)
pathName.pathName - the root of the checked out repositorypublic java.lang.String absolutePathToUrl(java.lang.String absolute)
absolute - Example: /trunk/statsvn/package.htmlpublic java.lang.String absoluteToRelativePath(java.lang.String stringData)
absolute - Example (assume getModuleName() returns /trunk/statsvn)
/trunk/statsvn/package.htmlpublic void addDirectory(java.lang.String relativePath)
relativePath - the relative path.public boolean existsInWorkingCopy(java.lang.String relativePath)
relativePath - the pathprotected int getLineCount(java.io.BufferedReader reader)
throws java.io.IOException
reader - the buffered readerjava.io.IOException - error reading from readerpublic int[] getLineDiff(java.lang.String oldRevNr,
java.lang.String newRevNr,
java.lang.String filename)
throws java.io.IOException,
BinaryDiffException
oldRevNr - old revision numbernewRevNr - new revision numberfilename - the filenamejava.io.IOException - problem parsing the streamBinaryDiffException - if the error message is due to trying to diff binary files.public java.util.Vector getRevisionDiff(java.lang.String newRevNr)
throws java.io.IOException,
BinaryDiffException
newRevNr - new revision numberjava.io.IOException - problem parsing the streamBinaryDiffException - if the error message is due to trying to diff binary files.public int getLinesOfCode(java.lang.String filename)
throws net.sf.statcvs.input.NoLineCountException
filename - a file in the repositorynet.sf.statcvs.input.NoLineCountException - when the line count could not be retrieved, for example when
the file was not found.public java.lang.String getModuleName()
public java.lang.String getRepositoryUuid()
public java.lang.String getRevision(java.lang.String filename)
throws java.io.IOException
filename - the filenamejava.io.IOExceptionpublic java.lang.String getRootRevisionNumber()
public boolean isBinary(java.lang.String relativePath)
relativePath - the directorypublic boolean isDirectory(java.lang.String relativePath)
relativePath - the pathpublic void loadInfo()
throws net.sf.statcvs.input.LogSyntaxException,
java.io.IOException
net.sf.statcvs.input.LogSyntaxException - if the svn info --xml is malformedjava.io.IOException - if there is an error reading from the streampublic java.lang.String relativePathToUrl(java.lang.String relative)
relative - Example: src/Messages.javapublic java.lang.String relativeToAbsolutePath(java.lang.String relative)
relative - Example: src/Messages.javapublic java.lang.String urlToAbsolutePath(java.lang.String url)
url - Examples: svn://svn.statsvn.org/statsvn/trunk/statsvn,
svn://svn.statsvn.org/statsvn/trunk/statsvn/package.htmlpublic java.lang.String urlToRelativePath(java.lang.String url)
url - Examples: svn://svn.statsvn.org/statsvn/trunk/statsvn,
svn://svn.statsvn.org/statsvn/trunk/statsvn/package.htmlpublic ISvnProcessor getProcessor()
protected ISvnDiffProcessor getDiffProcessor()
protected ISvnInfoProcessor getInfoProcessor()
protected ISvnPropgetProcessor getPropgetProcessor()
protected ISvnVersionProcessor getVersionProcessor()