public class SvnNewDiffGenerator extends java.lang.Object implements ISVNDiffGenerator
| Constructor and Description |
|---|
SvnNewDiffGenerator(ISvnDiffGenerator generator) |
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
createTempDirectory()
Creates a temporary directory (when necessary) where temporary files
will be created.
|
void |
displayAddedDirectory(java.lang.String path,
java.lang.String rev1,
java.lang.String rev2)
Notifies this generator that the directory was added in revision
rev2. |
void |
displayDeletedDirectory(java.lang.String path,
java.lang.String rev1,
java.lang.String rev2)
Notifies this generator that the directory was deleted in revision
rev2. |
void |
displayFileDiff(java.lang.String path,
java.io.File file1,
java.io.File file2,
java.lang.String rev1,
java.lang.String rev2,
java.lang.String mimeType1,
java.lang.String mimeType2,
java.io.OutputStream result)
Generates and writes differences between two files to the specified
output stream.
|
void |
displayPropDiff(java.lang.String path,
SVNProperties baseProps,
SVNProperties diff,
java.io.OutputStream result)
Writes the differences in file properties to the specified output
stream.
|
ISvnDiffGenerator |
getDelegate() |
java.lang.String |
getEncoding()
Gets the encoding charset being in use for a diff output.
|
byte[] |
getEOL()
Returns the EOL marker bytes used in diff output.
|
void |
init(java.lang.String anchorPath1,
java.lang.String anchorPath2)
Initializes the driver setting up the paths/URLs that should be compared, or
root paths/URLs for those paths to which a diff operation should be restricted.
|
boolean |
isDiffAdded()
Tells whether added files are enabled to be diffed.
|
boolean |
isDiffCopied()
Tells whether copied files are enabled to be diffed against their
copy sources.
|
boolean |
isDiffDeleted()
Tells whether deleted files are enabled to be diffed.
|
boolean |
isDiffUnversioned()
Says if unversioned files are also diffed or ignored.
|
boolean |
isForcedBinaryDiff()
Tells whether to force diff even if files are binary.
|
void |
setBasePath(java.io.File basePath)
Sets the root path for this diff generator.
|
void |
setDiffAdded(boolean isDiffAdded)
Enables or disables generating differences for added
files.
|
void |
setDiffCopied(boolean isDiffCopied)
Enables or disables generating differences against copy source
for copied files.
|
void |
setDiffDeleted(boolean isDiffDeleted)
Enables or disables generating differences for deleted
files.
|
void |
setDiffUnversioned(boolean diffUnversioned)
Includes or not unversioned files into diff processing.
|
void |
setEncoding(java.lang.String encoding)
Sets the encoding charset to be used for a diff output.
|
void |
setEOL(byte[] eol)
Sets the EOL marker bytes to use in diff output.
|
void |
setForcedBinaryDiff(boolean forced)
Enables or disables generating differnces between files having
a binary MIME type.
|
public SvnNewDiffGenerator(ISvnDiffGenerator generator)
public ISvnDiffGenerator getDelegate()
public void init(java.lang.String anchorPath1,
java.lang.String anchorPath2)
ISVNDiffGenerator
These paths have got the same meaning as OLD-TGT (anchorPath1)
and NEW-TGT (anchorPath2) in the SVN command line client's
'svn diff' command. So, they can be either local paths, or URLs pointing to
repository locations. If one of them (or both) is a URL it may differ from that
one passed to an appropriate doDiff() method of SVNDiffClient in that
case when in a peg revision it's one URL, but in the target revision it was changed
(moved?) to some other one. So, this method should receive the real one.
init in interface ISVNDiffGeneratoranchorPath1 - an old path/URLanchorPath2 - a new path/URLpublic void setBasePath(java.io.File basePath)
ISVNDiffGeneratorThis can be used to make all paths in a diff output be relative to this base path.
setBasePath in interface ISVNDiffGeneratorbasePath - a base path for this driverpublic void setForcedBinaryDiff(boolean forced)
ISVNDiffGeneratorLike the '--force' option of the 'svn diff' command.
setForcedBinaryDiff in interface ISVNDiffGeneratorforced - if true binary
files will also be diffed, otherwise notpublic void setEncoding(java.lang.String encoding)
ISVNDiffGeneratorsetEncoding in interface ISVNDiffGeneratorencoding - the name of a charsetpublic java.lang.String getEncoding()
ISVNDiffGeneratorgetEncoding in interface ISVNDiffGeneratorpublic void setEOL(byte[] eol)
ISVNDiffGeneratorsetEOL in interface ISVNDiffGeneratoreol - EOL bytespublic byte[] getEOL()
ISVNDiffGeneratorgetEOL in interface ISVNDiffGeneratorpublic void setDiffDeleted(boolean isDiffDeleted)
ISVNDiffGeneratorsetDiffDeleted in interface ISVNDiffGeneratorisDiffDeleted - if true then
deleted files will be diffed, otherwise notISVNDiffGenerator.isDiffDeleted()public boolean isDiffDeleted()
ISVNDiffGeneratorisDiffDeleted in interface ISVNDiffGeneratorISVNDiffGenerator.setDiffDeleted(boolean)public void setDiffAdded(boolean isDiffAdded)
ISVNDiffGeneratorsetDiffAdded in interface ISVNDiffGeneratorisDiffAdded - if true then
added files will be diffed, otherwise notISVNDiffGenerator.isDiffAdded()public boolean isDiffAdded()
ISVNDiffGeneratorisDiffAdded in interface ISVNDiffGeneratorISVNDiffGenerator.setDiffAdded(boolean)public void setDiffCopied(boolean isDiffCopied)
ISVNDiffGeneratorSVNLookClient's diff
operations.
Like the '--diff-copy-from' option of the 'svnlook diff' command.
setDiffCopied in interface ISVNDiffGeneratorisDiffCopied - if true then
copied files will be diffed against copy sources,
otherwise they will be treated as newly added filesISVNDiffGenerator.isDiffCopied()public boolean isDiffCopied()
ISVNDiffGeneratorSVNLookClient's diff
operations.isDiffCopied in interface ISVNDiffGeneratorISVNDiffGenerator.setDiffCopied(boolean)public void setDiffUnversioned(boolean diffUnversioned)
ISVNDiffGenerator
If a diff operation is invoked on a versioned directory and
diffUnversioned is true
then all unversioned files that may be met in the directory will
be processed as added. Otherwise if diffUnversioned
is false such files are ignored.
setDiffUnversioned in interface ISVNDiffGeneratordiffUnversioned - controls whether to diff unversioned files
or notISVNDiffGenerator.isDiffUnversioned()public boolean isDiffUnversioned()
ISVNDiffGeneratorisDiffUnversioned in interface ISVNDiffGeneratorISVNDiffGenerator.setDiffUnversioned(boolean)public java.io.File createTempDirectory()
throws SVNException
ISVNDiffGeneratorThis temporary directory exists till the end of the diff operation.
createTempDirectory in interface ISVNDiffGeneratorSVNException - if a directory can not be createdpublic void displayPropDiff(java.lang.String path,
SVNProperties baseProps,
SVNProperties diff,
java.io.OutputStream result)
throws SVNException
ISVNDiffGeneratordisplayPropDiff in interface ISVNDiffGeneratorpath - a file path on which the property changes
are written to the outputbaseProps - a Map of old properties
(property names are mapped to their values)diff - a Map of changed properties
(property names are mapped to their values)result - the target OutputStream where
the differences will be written toSVNException - if can not save diff datapublic void displayFileDiff(java.lang.String path,
java.io.File file1,
java.io.File file2,
java.lang.String rev1,
java.lang.String rev2,
java.lang.String mimeType1,
java.lang.String mimeType2,
java.io.OutputStream result)
throws SVNException
ISVNDiffGenerator
file1 or file2 may be temporary files crteated
to get file contents from the repository (when running diff on URLs).
These temporary files will be deleted with the temporary directory
(created by ISVNDiffGenerator.createTempDirectory()) when the operation ends up.
displayFileDiff in interface ISVNDiffGeneratorpath - a file path on which the differences are
generated and written to the outputfile1 - a file with old contentsfile2 - a file with new contentsrev1 - the first diff revision of file1rev2 - the second diff revision of file2mimeType1 - the MIME-type of file1mimeType2 - the MIME-type of file2result - the target OutputStream where
the differences will be written toSVNException - if can not save diff datapublic void displayDeletedDirectory(java.lang.String path,
java.lang.String rev1,
java.lang.String rev2)
throws SVNException
ISVNDiffGeneratorrev2.displayDeletedDirectory in interface ISVNDiffGeneratorpath - a directory pathrev1 - the first diff revisionrev2 - the second diff revisionSVNExceptionpublic void displayAddedDirectory(java.lang.String path,
java.lang.String rev1,
java.lang.String rev2)
throws SVNException
ISVNDiffGeneratorrev2.displayAddedDirectory in interface ISVNDiffGeneratorpath - a directory pathrev1 - the first diff revisionrev2 - the second diff revisionSVNExceptionpublic boolean isForcedBinaryDiff()
ISVNDiffGeneratorisForcedBinaryDiff in interface ISVNDiffGeneratorCopyright © 2004-2012 TMate Software Ltd. All Rights Reserved.