Class SVNDeltaProcessor
- java.lang.Object
-
- org.tmatesoft.svn.core.io.diff.SVNDeltaProcessor
-
public class SVNDeltaProcessor extends java.lang.ObjectThe SVNDeltaProcessor is used to get a full text of a file in series applying diff windows being passed to a processor.- Since:
- 1.2
- Version:
- 1.3
- Author:
- TMate Software Ltd.
-
-
Constructor Summary
Constructors Constructor Description SVNDeltaProcessor()Creates a processor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyTextDelta(java.io.File baseFile, java.io.File targetFile, boolean computeCheksum)Starts processing deltas given a base file and a one to write resultant target bytes to.voidapplyTextDelta(java.io.InputStream baseIS, java.io.File targetFile, boolean computeTargetCheksum)Starts processing deltas given a base file and a one to write resultant target bytes to.voidapplyTextDelta(java.io.InputStream base, java.io.OutputStream target, boolean computeCheksum)Starts processing deltas given a base file stream and an output stream to write resultant target bytes to.java.io.OutputStreamtextDeltaChunk(SVNDiffWindow window)Receives a next diff window to be applied.java.lang.StringtextDeltaEnd()Performs delta processing finalizing steps.
-
-
-
Method Detail
-
applyTextDelta
public void applyTextDelta(java.io.InputStream base, java.io.OutputStream target, boolean computeCheksum)Starts processing deltas given a base file stream and an output stream to write resultant target bytes to.If a target full text is a newly added file (text deltas would be vs. empty), then source bytes are not needed and
basemay be passed as null.If
computeChecksumis true, then an MD5 checksum will be calculated for target bytes. The calculated checksum is returned bytextDeltaEnd().- Parameters:
base- an input stream to take base file contents fromtarget- an output stream to write the resultant target contents tocomputeCheksum- true to calculate checksum
-
applyTextDelta
public void applyTextDelta(java.io.File baseFile, java.io.File targetFile, boolean computeCheksum) throws SVNExceptionStarts processing deltas given a base file and a one to write resultant target bytes to.If a target full text is a newly added file (text deltas would be vs. empty), then source bytes are not needed and
baseFilemay be passed as null.If a file represented by
targetFiledoes not exist yet, first tries to create an empty file.If
computeChecksumis true, then an MD5 checksum will be calculated for target bytes. The calculated checksum is returned bytextDeltaEnd().- Parameters:
baseFile- a base file to read base file contents fromtargetFile- a destination file where resultant target bytes will be writtencomputeCheksum- true to calculate checksum- Throws:
SVNException
-
applyTextDelta
public void applyTextDelta(java.io.InputStream baseIS, java.io.File targetFile, boolean computeTargetCheksum) throws SVNExceptionStarts processing deltas given a base file and a one to write resultant target bytes to.If a target full text is a newly added file (text deltas would be vs. empty), then source bytes are not needed and
baseISmay be passed as null.If a file represented by
targetFiledoes not exist yet, first tries to create an empty file.If
computeTargetChecksumis true, then an MD5 checksum will be calculated for target bytes. The calculated checksum is returned bytextDeltaEnd().- Parameters:
baseIS- an input stream to take base file contents fromtargetFile- a destination file where resultant target bytes will be writtencomputeTargetCheksum- true to calculate checksum of the target text- Throws:
SVNException- Since:
- 1.3
-
textDeltaChunk
public java.io.OutputStream textDeltaChunk(SVNDiffWindow window) throws SVNException
Receives a next diff window to be applied. The return value is a dummy stream (left for backward compatibility) since new data should come within a diff window.- Parameters:
window- a diff window- Returns:
- a dummy output stream
- Throws:
SVNException
-
textDeltaEnd
public java.lang.String textDeltaEnd()
Performs delta processing finalizing steps. Applies the last window left (if any) and finalizes checksum calculation (if a checksum was required).- Returns:
- a string representing a hex form of the calculated MD5 checksum or null if checksum calculation was not required
-
-