|
JavaSVN Home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tmatesoft.svn.core.wc.DefaultSVNDiffGenerator
DefaultSVNDiffGenerator is a default implementation of ISVNDiffGenerator.
By default, if there's no any specified implementation of the diff generator's
interface, JavaSVN uses this default implementation. To set a custom
diff driver use setDiffGenerator().
| Field Summary | |
protected static InputStream |
EMPTY_FILE_IS
|
protected static byte[] |
EOL
|
protected static byte[] |
HEADER_SEPARATOR
|
protected static byte[] |
PROPERTIES_SEPARATOR
|
protected static String |
WC_REVISION_LABEL
|
| Constructor Summary | |
DefaultSVNDiffGenerator()
Constructs a DefaultSVNDiffGenerator. |
|
| Method Summary | |
File |
createTempDirectory()
Creates a temporary directory (when necessary) where temporary files will be created. |
void |
displayFileDiff(String path,
File file1,
File file2,
String rev1,
String rev2,
String mimeType1,
String mimeType2,
OutputStream result)
Generates and writes differences between two files to the specified output stream. |
void |
displayPropDiff(String path,
Map baseProps,
Map diff,
OutputStream result)
Writes the differences in file properties to the specified output stream. |
protected File |
getBasePath()
|
protected String |
getDisplayPath(String path)
|
String |
getEncoding()
Gets the encoding charset being in use for a diff output. |
void |
init(String anchorPath1,
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 |
isDiffDeleted()
Tells whether deleted files are enabled to be diffed. |
protected boolean |
isForcedBinaryDiff()
|
void |
setBasePath(File basePath)
Sets the root path for this diff generator. |
void |
setDiffDeleted(boolean isDiffDeleted)
Enables or disables generating differences for deleted files. |
void |
setEncoding(String encoding)
Sets the encoding charset to be used for a diff output. |
void |
setForcedBinaryDiff(boolean forced)
Enables or disables generating differnces between files having a binary MIME type. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final byte[] PROPERTIES_SEPARATOR
protected static final byte[] HEADER_SEPARATOR
protected static final byte[] EOL
protected static final String WC_REVISION_LABEL
protected static final InputStream EMPTY_FILE_IS
| Constructor Detail |
public DefaultSVNDiffGenerator()
| Method Detail |
public void init(String anchorPath1,
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(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 setDiffDeleted(boolean isDiffDeleted)
ISVNDiffGeneratorLike the '--no-diff-deleted' option of the 'svn diff' command.
setDiffDeleted in interface ISVNDiffGeneratorisDiffDeleted - if true then
deleted files will be diffed, otherwise notpublic boolean isDiffDeleted()
ISVNDiffGenerator
isDiffDeleted in interface ISVNDiffGeneratorprotected String getDisplayPath(String path)
public 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 notprotected boolean isForcedBinaryDiff()
public void displayPropDiff(String path,
Map baseProps,
Map diff,
OutputStream result)
throws SVNException
ISVNDiffGenerator
displayPropDiff 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 to
SVNException - if can not save diff dataprotected File getBasePath()
public void displayFileDiff(String path,
File file1,
File file2,
String rev1,
String rev2,
String mimeType1,
String mimeType2,
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 revision of file1rev2 - the revision of file2mimeType1 - the MIME-type of file1mimeType2 - the MIME-type of file2result - the target OutputStream where
the differences will be written to
SVNException - if can not save diff datapublic void setEncoding(String encoding)
ISVNDiffGenerator
setEncoding in interface ISVNDiffGeneratorencoding - the name of a charsetpublic String getEncoding()
ISVNDiffGenerator
getEncoding in interface ISVNDiffGenerator
public 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 created
|
JavaSVN Home | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||