net.sf.statsvn.input
public class RepositoryFileManager extends Object
Constructor and Description |
---|
RepositoryFileManager(String pathName)
Creates a new instance with root at
pathName . |
Modifier and Type | Method and Description |
---|---|
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.
|
public RepositoryFileManager(String pathName)
pathName
.pathName
- the root of the checked out repositorypublic String absolutePathToUrl(String absolute)
absolute
- Example: /trunk/statsvn/package.htmlpublic String absoluteToRelativePath(String stringData)
absolute
- Example (assume getModuleName() returns /trunk/statsvn)
/trunk/statsvn/package.htmlpublic void addDirectory(String relativePath)
relativePath
- the relative path.public boolean existsInWorkingCopy(String relativePath)
relativePath
- the pathprotected int getLineCount(BufferedReader reader) throws IOException
reader
- the buffered readerIOException
- error reading from readerpublic int[] getLineDiff(String oldRevNr, String newRevNr, String filename) throws IOException, BinaryDiffException
oldRevNr
- old revision numbernewRevNr
- new revision numberfilename
- the filenameIOException
- problem parsing the streamBinaryDiffException
- if the error message is due to trying to diff binary files.public Vector getRevisionDiff(String newRevNr) throws IOException, BinaryDiffException
newRevNr
- new revision numberIOException
- problem parsing the streamBinaryDiffException
- 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 repositorynet.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 filenameIOException
public String getRootRevisionNumber()
public boolean isBinary(String relativePath)
relativePath
- the directorypublic boolean isDirectory(String relativePath)
relativePath
- the pathpublic void loadInfo() throws net.sf.statcvs.input.LogSyntaxException, IOException
net.sf.statcvs.input.LogSyntaxException
- if the svn info --xml is malformedIOException
- if there is an error reading from the streampublic String relativePathToUrl(String relative)
relative
- Example: src/Messages.javapublic String relativeToAbsolutePath(String relative)
relative
- Example: src/Messages.javapublic String urlToAbsolutePath(String url)
url
- Examples: svn://svn.statsvn.org/statsvn/trunk/statsvn,
svn://svn.statsvn.org/statsvn/trunk/statsvn/package.htmlpublic String urlToRelativePath(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()