org.opensolaris.opengrok.history
Class HistoryReader
java.lang.Object
java.io.Reader
org.opensolaris.opengrok.history.HistoryReader
- All Implemented Interfaces:
- java.io.Closeable, java.lang.Readable
- Direct Known Subclasses:
- DirectoryHistoryReader
public class HistoryReader
- extends java.io.Reader
Class for reading history entries. The HistoryReader have
tree mutually exclusive usages:
- where you read it as if from a Reader (used by lucene)
- you read each entry as one string ( one line = rev + date + author +
comment) used for showing matching context in search results. '\n'
doesn't matter.
- you read it in a structured way. (used by history.jsp)
Please note that it is the clients responsibility that if one access pattern
is used, it should not switch access method.
Fields inherited from class java.io.Reader |
lock |
Methods inherited from class java.io.Reader |
mark, markSupported, read, read, read, ready, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
next
public boolean next()
throws java.io.IOException
- Read a single line of delta record and sets
- Returns:
- true if more log records exist
Eg.
do {
r.getRevision();
} while(r.next())
- Throws:
java.io.IOException
getLine
public java.lang.String getLine()
- Returns:
- get the history line in one String of current log record
getRevision
public java.lang.String getRevision()
- Returns:
- get the revision string of current log record
getDate
public java.util.Date getDate()
- Returns:
- get the date assosiated with current log record
getAuthor
public java.lang.String getAuthor()
- Returns:
- get the author of current log record
getComment
public java.lang.String getComment()
- Returns:
- get the comments of current log record
isActive
public boolean isActive()
- Returns:
- Does current log record is actually point to a revision
read
public int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
- Specified by:
read
in class java.io.Reader
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Specified by:
close
in class java.io.Reader
- Throws:
java.io.IOException
getFiles
public java.util.List<java.lang.String> getFiles()
getRepositoryPath
public java.io.File getRepositoryPath()
getSourceRootPath
public java.io.File getSourceRootPath()