public final class HistoryGuru
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addRepositories(java.lang.String dir)
Search through the all of the directories and add all of the source
repositories found.
|
Annotation |
annotate(java.io.File file,
java.lang.String rev)
Annotate the specified revision of a file.
|
void |
createCache()
Create the history cache for all of the repositories
|
void |
createCache(java.util.Collection<java.lang.String> repositories) |
void |
ensureHistoryCacheExists(java.io.File file)
Ensure that we have a directory in the cache.
|
java.lang.String |
getCacheInfo()
Get a string with information about the history cache.
|
History |
getHistory(java.io.File file)
Get the history for the specified file.
|
History |
getHistory(java.io.File file,
boolean withFiles)
Get the history for the specified file.
|
HistoryReader |
getHistoryReader(java.io.File file)
Get the appropriate history reader for the file specified by parent and
basename.
|
static HistoryGuru |
getInstance()
Get the one and only instance of the HistoryGuru
|
protected Repository |
getRepository(java.io.File path) |
java.io.InputStream |
getRevision(java.lang.String parent,
java.lang.String basename,
java.lang.String rev)
Get a named revision of the specified file.
|
boolean |
hasAnnotation(java.io.File file)
Check if we can annotate the specified file.
|
boolean |
hasHistory(java.io.File file)
Does this directory contain files with source control information?
|
void |
invalidateRepositories(java.util.Collection<? extends RepositoryInfo> repos)
Invalidate the current list of known repositories!
|
void |
removeCache(java.util.Collection<java.lang.String> repositories) |
void |
updateRepositories()
Update the source the contents in the source repositories.
|
void |
updateRepositories(java.util.Collection<java.lang.String> paths)
Update the source the contents in the source repositories.
|
public static HistoryGuru getInstance()
public java.lang.String getCacheInfo() throws HistoryException
HistoryException
- if an error occurred while getting the infopublic Annotation annotate(java.io.File file, java.lang.String rev) throws java.io.IOException
file
- the file to annotaterev
- the revision to annotate (null
means BASE)null
if the
HistoryParser
does not support annotationjava.io.IOException
public HistoryReader getHistoryReader(java.io.File file) throws HistoryException
file
- The file to get the history reader forHistoryException
- If an error occurs while getting the historypublic History getHistory(java.io.File file) throws HistoryException
file
- the file to get the history forHistoryException
- on error when accessing the historypublic History getHistory(java.io.File file, boolean withFiles) throws HistoryException
file
- the file to get the history forwithFiles
- whether or not the returned history should contain
a list of files touched by each changeset (the file list may be skipped
if false, but it doesn't have to)HistoryException
- on error when accessing the historypublic java.io.InputStream getRevision(java.lang.String parent, java.lang.String basename, java.lang.String rev)
parent
- The directory containing the filebasename
- The name of the filerev
- The revision to getpublic boolean hasHistory(java.io.File file)
file
- The name of the directorypublic boolean hasAnnotation(java.io.File file)
file
- the file to checktrue
if the file is under version control and the
version control system supports annotationpublic void addRepositories(java.lang.String dir)
dir
- the root directory to start the search in.public void updateRepositories()
public void updateRepositories(java.util.Collection<java.lang.String> paths)
paths
- A list of files/directories to updatepublic void createCache(java.util.Collection<java.lang.String> repositories)
public void removeCache(java.util.Collection<java.lang.String> repositories) throws HistoryException
HistoryException
public void createCache()
public void ensureHistoryCacheExists(java.io.File file) throws HistoryException
file
- the root path to testHistoryException
- if an error occurs while accessing the
history cacheprotected Repository getRepository(java.io.File path)
public void invalidateRepositories(java.util.Collection<? extends RepositoryInfo> repos)
repos
- The new repositories