|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.statsvn.input.RepositoryFileManager
public class 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(java.lang.String pathName)
Creates a new instance with root at pathName . |
Method Summary | |
---|---|
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 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. |
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. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RepositoryFileManager(java.lang.String pathName)
pathName
.
pathName
- the root of the checked out repositoryMethod Detail |
---|
public java.lang.String absolutePathToUrl(java.lang.String absolute)
absolute
- Example: /trunk/statsvn/package.html
public java.lang.String absoluteToRelativePath(java.lang.String stringData)
absolute
- Example (assume getModuleName() returns /trunk/statsvn)
/trunk/statsvn/package.html
public void addDirectory(java.lang.String relativePath)
relativePath
- the relative path.public boolean existsInWorkingCopy(java.lang.String relativePath)
relativePath
- the path
protected int getLineCount(java.io.BufferedReader reader) throws java.io.IOException
reader
- the buffered reader
java.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 filename
java.io.IOException
- problem parsing the stream
BinaryDiffException
- 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 number
java.io.IOException
- problem parsing the stream
BinaryDiffException
- 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 repository
net.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 filename
java.io.IOException
public java.lang.String getRootRevisionNumber()
public boolean isBinary(java.lang.String relativePath)
relativePath
- the directory
public boolean isDirectory(java.lang.String relativePath)
relativePath
- the path
public void loadInfo() throws net.sf.statcvs.input.LogSyntaxException, java.io.IOException
net.sf.statcvs.input.LogSyntaxException
- if the svn info --xml is malformed
java.io.IOException
- if there is an error reading from the streampublic java.lang.String relativePathToUrl(java.lang.String relative)
relative
- Example: src/Messages.java
public java.lang.String relativeToAbsolutePath(java.lang.String relative)
relative
- Example: src/Messages.java
public 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.html
public 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.html
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |