JavaSVN Home

org.tmatesoft.svn.core.io.diff
Class SVNDeltaProcessor

java.lang.Object
  extended byorg.tmatesoft.svn.core.io.diff.SVNDeltaProcessor

public class SVNDeltaProcessor
extends Object

The SVNDeltaProcessor is used to get a full text of a file in series applying diff windows being passed to a processor.

Version:
1.0
Author:
TMate Software Ltd.

Constructor Summary
SVNDeltaProcessor()
          Creates a processor with a buffer for new data of a fixed size - 100Kbytes.
SVNDeltaProcessor(int inialNewDataSize)
          Creates a processor with a buffer for new data of a fixed size - inialNewDataSize.
 
Method Summary
 void applyTextDelta(File baseFile, File targetFile, boolean computeCheksum)
          Starts processing deltas given a base file and one to write resultant target bytes to.
 void applyTextDelta(InputStream base, OutputStream target, boolean computeCheksum)
          Starts processing deltas given a base file stream and an output stream to write resultant target bytes to.
 OutputStream textDeltaChunk(SVNDiffWindow window)
          Receives a next diff window to be applied and returns a stream for new data bytes of the window to be written to.
 String textDeltaEnd()
          Performs delta processing finalizing steps.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVNDeltaProcessor

public SVNDeltaProcessor()
Creates a processor with a buffer for new data of a fixed size - 100Kbytes.


SVNDeltaProcessor

public SVNDeltaProcessor(int inialNewDataSize)
Creates a processor with a buffer for new data of a fixed size - inialNewDataSize.

Parameters:
inialNewDataSize -
Method Detail

applyTextDelta

public void applyTextDelta(InputStream base,
                           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 base may be passed as null.

If computeChecksum is true, then an MD5 checksum will be calculated for target bytes.

Parameters:
base - an input stream to take base file contents from
target - an output stream to write the resultant target contents to
computeCheksum - true to calculate checksum

applyTextDelta

public void applyTextDelta(File baseFile,
                           File targetFile,
                           boolean computeCheksum)
                    throws SVNException
Starts processing deltas given a base file and 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 baseFile may be passed as null.

If a file represented by targetFile does not exist yet, first tries to create an empty file.

If computeChecksum is true, then an MD5 checksum will be calculated for target bytes.

Parameters:
baseFile - a base file to read base file contents from
targetFile - a destination file where resultant target bytes will be written
computeCheksum - true to calculate checksum
Throws:
SVNException

textDeltaChunk

public OutputStream textDeltaChunk(SVNDiffWindow window)
                            throws SVNException
Receives a next diff window to be applied and returns a stream for new data bytes of the window to be written to.

Parameters:
window - a diff window
Returns:
an output stream where new data bytes will be written to
Throws:
SVNException

textDeltaEnd

public String textDeltaEnd()
                    throws SVNException
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
Throws:
SVNException

JavaSVN Home

Copyright © 2004-2006 TMate Software Ltd. All Rights Reserved.