public final class Revisions extends Object
DiffSupport.REVISIONS_PROPERTY
.Modifier and Type | Class and Description |
---|---|
static class |
Revisions.Delta
The binary delta between revision #revisionNumber+1 and
revision #revisionNumber.
|
Modifier and Type | Field and Description |
---|---|
Revisions.Delta[] |
deltas |
byte[] |
previousRevisionContent |
Date |
previousRevisionDate |
String |
previousRevisionEditor |
Modifier and Type | Method and Description |
---|---|
Date |
getCurrentRevisionDate()
Returns the date of the current revision (that is,
the revision corresponding to the document being edited).
|
String |
getCurrentRevisionEditor(CommandEnv env)
Returns the ID of the current user of the application.
|
String |
getCurrentRevisionEditor(Document doc)
Returns the creator of the current revision (that is,
the revision corresponding to the document being edited).
|
int |
getCurrentRevisionNumber()
Returns the number of the current revision (that is,
the revision corresponding to the document being edited).
|
byte[] |
getRevision(int revisionNumber,
ProgressMonitor progressMonitor)
Returns the content of revision #revisionNumber.
|
static byte[] |
toBytes(Document doc)
Not part of the public, documented, API: returns the UTF-8 bytes
corresponding to a normalized XML form of specified document.
|
public final Date previousRevisionDate
public final String previousRevisionEditor
public final byte[] previousRevisionContent
public final Revisions.Delta[] deltas
public int getCurrentRevisionNumber()
public Date getCurrentRevisionDate()
public String getCurrentRevisionEditor(Document doc)
doc
- the document being edited used as a contextpublic String getCurrentRevisionEditor(CommandEnv env)
env
- the environment info needed to execute commandspublic static byte[] toBytes(Document doc)
public byte[] getRevision(int revisionNumber, ProgressMonitor progressMonitor) throws IndexOutOfBoundsException, IOException
revisionNumber
- number of the revisionprogressMonitor
- a progress monitor allowing to provide
the user with a feedback while the content of the revision is
rebuilt out of binary deltas. May be null
.IndexOutOfBoundsException
- if
revisionNumber < 1 ||
revisionNumber >= currentRevisionNumber
IOException
- if, for any reason, the binary deltas
cannot be used to rebuild the content of the revision