Class DefaultSVNGNUDiffGenerator
java.lang.Object
org.tmatesoft.svn.core.wc.DefaultSVNDiffGenerator
org.tmatesoft.svn.core.internal.wc.DefaultSVNGNUDiffGenerator
- All Implemented Interfaces:
ISVNGNUDiffGenerator
,ISVNDiffGenerator
public class DefaultSVNGNUDiffGenerator
extends DefaultSVNDiffGenerator
implements ISVNGNUDiffGenerator
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private boolean
private boolean
private String
private FSRoot
private String
private FSRoot
Fields inherited from class org.tmatesoft.svn.core.wc.DefaultSVNDiffGenerator
EMPTY_FILE_IS, HEADER_SEPARATOR, PROPERTIES_SEPARATOR, WC_REVISION_LABEL
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
displayBinary
(OutputStream os, String mimeType1, String mimeType2) void
displayFileDiff
(String path, File file1, File file2, String rev1, String rev2, String mimeType1, String mimeType2, OutputStream result) Writes the difference betweenfile1
andfile2
as they are seen inrev1
andrev2
toresult
.void
displayHeader
(int type, String path, String copyFromPath, long copyFromRevision, OutputStream result) Informs this diff generator about a change to a path.protected boolean
displayHeader
(OutputStream os, String path, boolean deleted) protected void
displayHeaderFields
(OutputStream os, String label1, String label2) private String
generateLabel
(FSRoot root, String path) boolean
void
void
setDiffWritten
(boolean b) void
setHeaderWritten
(boolean written) protected void
setNewFile
(FSRoot newRoot, String newPath) protected void
setOriginalFile
(FSRoot originalRoot, String originalPath) protected boolean
Methods inherited from class org.tmatesoft.svn.core.wc.DefaultSVNDiffGenerator
createTempDirectory, displayAddedDirectory, displayDeletedDirectory, displayPropDiff, getBasePath, getDiffOptions, getDisplayPath, getEncoding, getEOL, getExternalDiffCommand, getGlobalEncoding, getLabel, getOptions, hasEncoding, hasEOL, init, isDiffAdded, isDiffCopied, isDiffDeleted, isDiffUnversioned, isForcedBinaryDiff, isHeaderForced, setBasePath, setDiffAdded, setDiffCopied, setDiffDeleted, setDiffOptions, setDiffUnversioned, setEncoding, setEOL, setExternalDiffCommand, setFallbackToAbsolutePath, setForcedBinaryDiff, setOptions, setRawDiffOptions
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.tmatesoft.svn.core.wc.ISVNDiffGenerator
createTempDirectory, displayAddedDirectory, displayDeletedDirectory, displayPropDiff, getEncoding, getEOL, init, isDiffAdded, isDiffCopied, isDiffDeleted, isDiffUnversioned, isForcedBinaryDiff, setBasePath, setDiffAdded, setDiffCopied, setDiffDeleted, setDiffUnversioned, setEncoding, setEOL, setForcedBinaryDiff
-
Field Details
-
myHeader
-
myIsHeaderWritten
private boolean myIsHeaderWritten -
myOriginalRoot
-
myOriginalPath
-
myNewRoot
-
myNewPath
-
myIsDiffWritten
private boolean myIsDiffWritten
-
-
Constructor Details
-
DefaultSVNGNUDiffGenerator
public DefaultSVNGNUDiffGenerator()
-
-
Method Details
-
displayHeader
public void displayHeader(int type, String path, String copyFromPath, long copyFromRevision, OutputStream result) throws SVNException Description copied from interface:ISVNGNUDiffGenerator
Informs this diff generator about a change to a path.- Specified by:
displayHeader
in interfaceISVNGNUDiffGenerator
- Parameters:
type
- one of static fields of this interfacepath
- a changed pathcopyFromPath
- a copy-from source path ifpath
is the result of a copycopyFromRevision
- a copy-from source revision ifpath
is the result of a copyresult
- an output stream where a header is to be written- Throws:
SVNException
-
displayFileDiff
public void displayFileDiff(String path, File file1, File file2, String rev1, String rev2, String mimeType1, String mimeType2, OutputStream result) throws SVNException Description copied from class:DefaultSVNDiffGenerator
Writes the difference betweenfile1
andfile2
as they are seen inrev1
andrev2
toresult
.- Specified by:
displayFileDiff
in interfaceISVNDiffGenerator
- Overrides:
displayFileDiff
in classDefaultSVNDiffGenerator
- Parameters:
path
- 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 offile1
rev2
- the second diff revision offile2
mimeType1
- the MIME-type offile1
mimeType2
- the MIME-type offile2
result
- the targetOutputStream
where the differences will be written to- Throws:
SVNException
- in the following cases:-
exception with
SVNErrorCode.EXTERNAL_PROGRAM
error code - if an external diff program exited with an error code value different from0
and1
exception withSVNErrorCode.IO_ERROR
error code - if an I\O error occurred
-
setHeaderWritten
public void setHeaderWritten(boolean written) -
displayHeader
- Overrides:
displayHeader
in classDefaultSVNDiffGenerator
- Throws:
IOException
-
displayBinary
protected void displayBinary(OutputStream os, String mimeType1, String mimeType2) throws IOException - Overrides:
displayBinary
in classDefaultSVNDiffGenerator
- Throws:
IOException
-
displayHeaderFields
protected void displayHeaderFields(OutputStream os, String label1, String label2) throws IOException - Overrides:
displayHeaderFields
in classDefaultSVNDiffGenerator
- Throws:
IOException
-
setOriginalFile
-
setNewFile
-
generateLabel
- Throws:
SVNException
-
useLocalFileSeparatorChar
protected boolean useLocalFileSeparatorChar()- Overrides:
useLocalFileSeparatorChar
in classDefaultSVNDiffGenerator
-
setDiffWritten
public void setDiffWritten(boolean b) -
isDiffWritten
public boolean isDiffWritten() -
printHeader
- Throws:
SVNException
-