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
Fields Modifier and Type Field Description private java.lang.String
myHeader
private boolean
myIsDiffWritten
private boolean
myIsHeaderWritten
private java.lang.String
myNewPath
private FSRoot
myNewRoot
private java.lang.String
myOriginalPath
private FSRoot
myOriginalRoot
-
Fields inherited from class org.tmatesoft.svn.core.wc.DefaultSVNDiffGenerator
EMPTY_FILE_IS, HEADER_SEPARATOR, PROPERTIES_SEPARATOR, WC_REVISION_LABEL
-
-
Constructor Summary
Constructors Constructor Description DefaultSVNGNUDiffGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
displayBinary(java.io.OutputStream os, java.lang.String mimeType1, java.lang.String mimeType2)
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 betweenfile1
andfile2
as they are seen inrev1
andrev2
toresult
.void
displayHeader(int type, java.lang.String path, java.lang.String copyFromPath, long copyFromRevision, java.io.OutputStream result)
Informs this diff generator about a change to a path.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)
private java.lang.String
generateLabel(FSRoot root, java.lang.String path)
boolean
isDiffWritten()
void
printHeader(java.io.OutputStream os)
void
setDiffWritten(boolean b)
void
setHeaderWritten(boolean written)
protected void
setNewFile(FSRoot newRoot, java.lang.String newPath)
protected void
setOriginalFile(FSRoot originalRoot, java.lang.String originalPath)
protected boolean
useLocalFileSeparatorChar()
-
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 Detail
-
myHeader
private java.lang.String myHeader
-
myIsHeaderWritten
private boolean myIsHeaderWritten
-
myOriginalRoot
private FSRoot myOriginalRoot
-
myOriginalPath
private java.lang.String myOriginalPath
-
myNewRoot
private FSRoot myNewRoot
-
myNewPath
private java.lang.String myNewPath
-
myIsDiffWritten
private boolean myIsDiffWritten
-
-
Method Detail
-
displayHeader
public void displayHeader(int type, java.lang.String path, java.lang.String copyFromPath, long copyFromRevision, java.io.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(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
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
protected boolean displayHeader(java.io.OutputStream os, java.lang.String path, boolean deleted) throws java.io.IOException
- Overrides:
displayHeader
in classDefaultSVNDiffGenerator
- Throws:
java.io.IOException
-
displayBinary
protected void displayBinary(java.io.OutputStream os, java.lang.String mimeType1, java.lang.String mimeType2) throws java.io.IOException
- Overrides:
displayBinary
in classDefaultSVNDiffGenerator
- Throws:
java.io.IOException
-
displayHeaderFields
protected void displayHeaderFields(java.io.OutputStream os, java.lang.String label1, java.lang.String label2) throws java.io.IOException
- Overrides:
displayHeaderFields
in classDefaultSVNDiffGenerator
- Throws:
java.io.IOException
-
setOriginalFile
protected void setOriginalFile(FSRoot originalRoot, java.lang.String originalPath)
-
setNewFile
protected void setNewFile(FSRoot newRoot, java.lang.String newPath)
-
generateLabel
private java.lang.String generateLabel(FSRoot root, java.lang.String path) throws SVNException
- Throws:
SVNException
-
useLocalFileSeparatorChar
protected boolean useLocalFileSeparatorChar()
- Overrides:
useLocalFileSeparatorChar
in classDefaultSVNDiffGenerator
-
setDiffWritten
public void setDiffWritten(boolean b)
-
isDiffWritten
public boolean isDiffWritten()
-
printHeader
public void printHeader(java.io.OutputStream os) throws SVNException
- Throws:
SVNException
-
-