|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.sf.statsvn.input.RepositoryFileManager
Manages a checked-out repository and provides access to line number counts for repository files. New in StatSVN: Also provides a central point of access to abstract out calls to the server. Many of the methods here simply redirect to the static util/SvnXXXUtils classes. Therefore, clients don't have to know where the information is located, they can simply invoke this class.
| Constructor Summary | |
RepositoryFileManager(String pathName)
Creates a new instance with root at pathName. |
|
| Method Summary | |
String |
absolutePathToUrl(String absolute)
Converts an absolute path in the repository to a URL, using the repository URL |
String |
absoluteToRelativePath(String stringData)
Converts an absolute path in the repository to a path relative to the working folder root. |
void |
addDirectory(String relativePath)
Adds a directory to the list of known directories. |
boolean |
existsInWorkingCopy(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(BufferedReader reader)
Counts lines on a BufferedReader |
int[] |
getLineDiff(String oldRevNr,
String newRevNr,
String filename)
Returns line count differences between two revisions of a file. |
int |
getLinesOfCode(String filename)
Returns the lines of code for a repository file. |
String |
getModuleName()
Assumes #loadInfo(String) has been called. |
ISvnProcessor |
getProcessor()
|
protected ISvnPropgetProcessor |
getPropgetProcessor()
|
String |
getRepositoryUuid()
Assumes #loadInfo(String) has been called. |
String |
getRevision(String filename)
Returns the revision of filename in the local working directory by reading the svn metadata. |
Vector |
getRevisionDiff(String newRevNr)
Returns line count differences for all files in a particular revision. |
String |
getRootRevisionNumber()
Assumes #loadInfo(String) has been called. |
protected ISvnVersionProcessor |
getVersionProcessor()
|
boolean |
isBinary(String relativePath)
Is the given path a binary file in the working directory? |
boolean |
isDirectory(String relativePath)
Returns true if the path has been identified as a directory. |
void |
loadInfo()
Initializes our representation of the repository. |
String |
relativePathToUrl(String relative)
Converts a relative path in the working folder to a URL, using the working folder's root URL |
String |
relativeToAbsolutePath(String relative)
Converts a relative path in the working folder to an absolute path in the repository. |
String |
urlToAbsolutePath(String url)
Converts a url to an absolute path in the repository. |
String |
urlToRelativePath(String url)
Converts a url to a relative path in the repository. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RepositoryFileManager(String pathName)
pathName.
pathName - the root of the checked out repository| Method Detail |
public String absolutePathToUrl(String absolute)
absolute - Example: /trunk/statsvn/package.html
public String absoluteToRelativePath(String stringData)
public void addDirectory(String relativePath)
relativePath - the relative path.public boolean existsInWorkingCopy(String relativePath)
relativePath - the path
protected int getLineCount(BufferedReader reader)
throws IOException
reader - the buffered reader
IOException - error reading from reader
public int[] getLineDiff(String oldRevNr,
String newRevNr,
String filename)
throws IOException,
BinaryDiffException
oldRevNr - old revision numbernewRevNr - new revision numberfilename - the filename
IOException - problem parsing the stream
BinaryDiffException - if the error message is due to trying to diff binary files.
public Vector getRevisionDiff(String newRevNr)
throws IOException,
BinaryDiffException
newRevNr - new revision number
IOException - problem parsing the stream
BinaryDiffException - if the error message is due to trying to diff binary files.
public int getLinesOfCode(String filename)
throws net.sf.statcvs.input.NoLineCountException
filename - a file in the repository
net.sf.statcvs.input.NoLineCountException - when the line count could not be retrieved, for example when
the file was not found.public String getModuleName()
public String getRepositoryUuid()
public String getRevision(String filename)
throws IOException
filename - the filename
IOExceptionpublic String getRootRevisionNumber()
public boolean isBinary(String relativePath)
relativePath - the directory
public boolean isDirectory(String relativePath)
relativePath - the path
public void loadInfo()
throws net.sf.statcvs.input.LogSyntaxException,
IOException
net.sf.statcvs.input.LogSyntaxException - if the svn info --xml is malformed
IOException - if there is an error reading from the streampublic String relativePathToUrl(String relative)
relative - Example: src/Messages.java
public String relativeToAbsolutePath(String relative)
relative - Example: src/Messages.java
public String urlToAbsolutePath(String url)
url - Examples: svn://svn.statsvn.org/statsvn/trunk/statsvn,
svn://svn.statsvn.org/statsvn/trunk/statsvn/package.html
public String urlToRelativePath(String url)
url - Examples: svn://svn.statsvn.org/statsvn/trunk/statsvn,
svn://svn.statsvn.org/statsvn/trunk/statsvn/package.html
public ISvnProcessor getProcessor()
protected ISvnDiffProcessor getDiffProcessor()
protected ISvnInfoProcessor getInfoProcessor()
protected ISvnPropgetProcessor getPropgetProcessor()
protected ISvnVersionProcessor getVersionProcessor()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||