|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.tmatesoft.svn.core.wc.DefaultSVNDiffGenerator
public class DefaultSVNDiffGenerator
DefaultSVNDiffGenerator is a default implementation of ISVNDiffGenerator.
By default, if there's no any specified implementation of the diff generator's
interface, SVNKit uses this default implementation. To set a custom
diff driver use setDiffGenerator().
| Field Summary | |
|---|---|
protected static java.io.InputStream |
EMPTY_FILE_IS
|
protected static java.lang.String |
HEADER_SEPARATOR
|
protected static java.lang.String |
PROPERTIES_SEPARATOR
|
protected static java.lang.String |
WC_REVISION_LABEL
|
| Constructor Summary | |
|---|---|
DefaultSVNDiffGenerator()
Constructs a DefaultSVNDiffGenerator. |
|
| Method Summary | |
|---|---|
java.io.File |
createTempDirectory()
Creates a temporary directory for diff files. |
void |
displayAddedDirectory(java.lang.String path,
java.lang.String rev1,
java.lang.String rev2)
Does nothing. |
protected void |
displayBinary(java.io.OutputStream os,
java.lang.String mimeType1,
java.lang.String mimeType2)
|
void |
displayDeletedDirectory(java.lang.String path,
java.lang.String rev1,
java.lang.String rev2)
Does nothing. |
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)
Writes the difference between file1 and file2 as they are seen in
rev1 and rev2 to result. |
protected boolean |
displayHeader(java.io.OutputStream os,
java.lang.String path,
boolean deleted)
|
protected void |
displayHeaderFields(java.io.OutputStream os,
java.lang.String label1,
java.lang.String label2)
|
void |
displayPropDiff(java.lang.String path,
SVNProperties baseProps,
SVNProperties diff,
java.io.OutputStream result)
Produces properties difference and writes it to result. |
protected java.io.File |
getBasePath()
|
SVNDiffOptions |
getDiffOptions()
Gets the diff options that are used by this generator. |
protected java.lang.String |
getDisplayPath(java.lang.String path)
|
java.lang.String |
getEncoding()
Returns the encoding used for diff output. |
byte[] |
getEOL()
Returns the EOL marker bytes being in use. |
protected java.lang.String |
getExternalDiffCommand()
|
java.lang.String |
getGlobalEncoding()
Returns the encoding specified by svnkit.global-charset option of the global configuration. |
protected java.lang.String |
getLabel(java.lang.String path,
java.lang.String revToken)
|
protected ISVNOptions |
getOptions()
|
boolean |
hasEncoding()
Says whether this generator is using any special (non-native) charset for outputting diffs. |
boolean |
hasEOL()
Says whether this generator is using any special (non-native) EOL bytes for outputting diffs. |
void |
init(java.lang.String anchorPath1,
java.lang.String anchorPath2)
Initializes this generator with old and new diff anchor paths. |
boolean |
isDiffAdded()
Tells whether added files must be diffed also. |
boolean |
isDiffCopied()
Tells whether deleted files must be diffed also. |
boolean |
isDiffDeleted()
Tells whether deleted files must be diffed also. |
boolean |
isDiffUnversioned()
Says if unversioned files are also diffed or ignored. |
boolean |
isForcedBinaryDiff()
Tells if this generator forced binary files diff. |
protected boolean |
isHeaderForced(java.io.File file1,
java.io.File file2)
|
void |
setBasePath(java.io.File basePath)
Sets the base path that must be stripped from the front of the paths of compared files. |
void |
setDiffAdded(boolean isDiffAdded)
Enables or disables diffing added files. |
void |
setDiffCopied(boolean isDiffCopied)
Enables or disables copied files diffing. |
void |
setDiffDeleted(boolean isDiffDeleted)
Enables or disables diffing deleted files. |
void |
setDiffOptions(SVNDiffOptions options)
Sets diff options containing diff rules. |
void |
setDiffUnversioned(boolean diffUnversioned)
Includes or not unversioned files into diff processing. |
void |
setEncoding(java.lang.String encoding)
Sets the encoding to use for diff output. |
void |
setEOL(byte[] eol)
Sets the EOL bytes to use in diff output. |
void |
setExternalDiffCommand(java.lang.String command)
Sets an external diff program for producing the difference between files. |
void |
setFallbackToAbsolutePath(boolean fallback)
Controls whether error is reported on failure to compute relative display path, or absolute path is used instead. |
void |
setForcedBinaryDiff(boolean forced)
Sets whether binary files diff must be forced or not. |
void |
setOptions(ISVNOptions options)
Sets global run-time options. |
void |
setRawDiffOptions(java.util.Collection options)
Sets a collection of raw ( String) diff options. |
protected boolean |
useLocalFileSeparatorChar()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String PROPERTIES_SEPARATOR
protected static final java.lang.String HEADER_SEPARATOR
protected static final java.lang.String WC_REVISION_LABEL
protected static final java.io.InputStream EMPTY_FILE_IS
| Constructor Detail |
|---|
public DefaultSVNDiffGenerator()
| Method Detail |
|---|
public void init(java.lang.String anchorPath1,
java.lang.String anchorPath2)
init in interface ISVNDiffGeneratoranchorPath1 - an old path/URLanchorPath2 - a new path/URLpublic void setDiffOptions(SVNDiffOptions options)
options - diff optionspublic void setRawDiffOptions(java.util.Collection options)
String) diff options.
options - raw optionspublic void setOptions(ISVNOptions options)
options - options implementationpublic void setExternalDiffCommand(java.lang.String command)
command - external diff programpublic void setBasePath(java.io.File basePath)
basePath is not null but is not a parent path of
the target, this will lead to an error during diff.
Note: basePath doesn't affect the path index generated by external diff programs.
setBasePath in interface ISVNDiffGeneratorbasePath - common parent path to strip off the displayed pathspublic void setFallbackToAbsolutePath(boolean fallback)
fallback - true to make generator use absolute path when relative path could not
be computed.public void setDiffDeleted(boolean isDiffDeleted)
setDiffDeleted in interface ISVNDiffGeneratorisDiffDeleted - ISVNDiffGenerator.isDiffDeleted()public boolean isDiffDeleted()
isDiffDeleted in interface ISVNDiffGeneratorISVNDiffGenerator.setDiffDeleted(boolean)public void setDiffAdded(boolean isDiffAdded)
setDiffAdded in interface ISVNDiffGeneratorisDiffAdded - ISVNDiffGenerator.isDiffAdded()public boolean isDiffAdded()
isDiffAdded in interface ISVNDiffGeneratorISVNDiffGenerator.setDiffAdded(boolean)public void setDiffCopied(boolean isDiffCopied)
setDiffCopied in interface ISVNDiffGeneratorisDiffCopied - ISVNDiffGenerator.isDiffCopied()public boolean isDiffCopied()
isDiffCopied in interface ISVNDiffGeneratorISVNDiffGenerator.setDiffCopied(boolean)public SVNDiffOptions getDiffOptions()
protected java.lang.String getDisplayPath(java.lang.String path)
throws SVNException
SVNExceptionpublic void setForcedBinaryDiff(boolean forced)
setForcedBinaryDiff in interface ISVNDiffGeneratorforced - whether to force binary diff or notpublic boolean isForcedBinaryDiff()
isForcedBinaryDiff in interface ISVNDiffGenerator
public void displayPropDiff(java.lang.String path,
SVNProperties baseProps,
SVNProperties diff,
java.io.OutputStream result)
throws SVNException
result.
displayPropDiff in interface ISVNDiffGeneratorpath - baseProps - diff - result -
SVNException - in the following cases:
SVNErrorCode.IO_ERROR error code - if an I\O error occurred
protected java.io.File getBasePath()
public 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
file1 and file2 as they are seen in
rev1 and rev2 to result.
displayFileDiff in interface ISVNDiffGeneratorpath - file1 - file2 - rev1 - rev2 - mimeType1 - mimeType2 - result -
SVNException - in the following cases:
SVNErrorCode.EXTERNAL_PROGRAM error code - if an external diff program
exited with an error code value different from 0 and 1
exception with SVNErrorCode.IO_ERROR error code - if an I\O error occurred
public void setEncoding(java.lang.String encoding)
setEncoding in interface ISVNDiffGeneratorencoding - charset namepublic java.lang.String getEncoding()
getEncoding in interface ISVNDiffGeneratorpublic boolean hasEncoding()
public boolean hasEOL()
public java.lang.String getGlobalEncoding()
public void setEOL(byte[] eol)
setEOL in interface ISVNDiffGeneratoreol - EOL bytespublic byte[] getEOL()
native EOL fetched from
the options.
getEOL in interface ISVNDiffGenerator
public java.io.File createTempDirectory()
throws SVNException
createTempDirectory in interface ISVNDiffGeneratorSVNExceptionpublic boolean isDiffUnversioned()
By default unversioned files are ignored.
isDiffUnversioned in interface ISVNDiffGeneratorsetDiffUnversioned(boolean)public void setDiffUnversioned(boolean diffUnversioned)
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.
By default unversioned files are ignored.
setDiffUnversioned in interface ISVNDiffGeneratordiffUnversioned - controls whether to diff unversioned files
or notisDiffUnversioned()
public void displayDeletedDirectory(java.lang.String path,
java.lang.String rev1,
java.lang.String rev2)
throws SVNException
displayDeletedDirectory in interface ISVNDiffGeneratorpath - a directory pathrev1 - the first diff revisionrev2 - the second diff revision
SVNException
public void displayAddedDirectory(java.lang.String path,
java.lang.String rev1,
java.lang.String rev2)
throws SVNException
displayAddedDirectory in interface ISVNDiffGeneratorpath - a directory pathrev1 - the first diff revisionrev2 - the second diff revision
SVNExceptionprotected java.lang.String getExternalDiffCommand()
protected ISVNOptions getOptions()
protected void displayBinary(java.io.OutputStream os,
java.lang.String mimeType1,
java.lang.String mimeType2)
throws java.io.IOException
java.io.IOException
protected boolean displayHeader(java.io.OutputStream os,
java.lang.String path,
boolean deleted)
throws java.io.IOException
java.io.IOException
protected void displayHeaderFields(java.io.OutputStream os,
java.lang.String label1,
java.lang.String label2)
throws java.io.IOException
java.io.IOException
protected boolean isHeaderForced(java.io.File file1,
java.io.File file2)
protected boolean useLocalFileSeparatorChar()
protected java.lang.String getLabel(java.lang.String path,
java.lang.String revToken)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||