org.tmatesoft.svn.core.wc

Class DefaultSVNDiffGenerator

public class DefaultSVNDiffGenerator extends Object implements ISVNDiffGenerator

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().

Version: 1.1.1

Author: TMate Software Ltd.

Field Summary
protected static InputStreamEMPTY_FILE_IS
protected static byte[]EOL
protected static byte[]HEADER_SEPARATOR
protected static byte[]PROPERTIES_SEPARATOR
protected static StringWC_REVISION_LABEL
Constructor Summary
DefaultSVNDiffGenerator()
Constructs a DefaultSVNDiffGenerator.
Method Summary
FilecreateTempDirectory()
voiddisplayAddedDirectory(String path, String rev1, String rev2)
Does nothing.
protected voiddisplayBinary(OutputStream os, String mimeType1, String mimeType2)
voiddisplayDeletedDirectory(String path, String rev1, String rev2)
Does nothing.
voiddisplayFileDiff(String path, File file1, File file2, String rev1, String rev2, String mimeType1, String mimeType2, OutputStream result)
protected booleandisplayHeader(OutputStream os, String path, boolean deleted)
protected voiddisplayHeaderFields(OutputStream os, String path1, String rev1, String path2, String rev2)
voiddisplayPropDiff(String path, Map baseProps, Map diff, OutputStream result)
protected FilegetBasePath()
SVNDiffOptionsgetDiffOptions()
Gets the diff options that are used by this generator.
protected StringgetDisplayPath(String path)
StringgetEncoding()
voidinit(String anchorPath1, String anchorPath2)
booleanisDiffAdded()
booleanisDiffCopied()
booleanisDiffDeleted()
booleanisDiffUnversioned()
Says if unversioned files are also diffed or ignored.
booleanisForcedBinaryDiff()
protected booleanisHeaderForced(File file1, File file2)
voidsetBasePath(File basePath)
voidsetDiffAdded(boolean isDiffAdded)
voidsetDiffCopied(boolean isDiffCopied)
voidsetDiffDeleted(boolean isDiffDeleted)
voidsetDiffOptions(SVNDiffOptions options)
Sets diff options containing diff rules.
voidsetDiffUnversioned(boolean diffUnversioned)
Includes or not unversioned files into diff processing.
voidsetEncoding(String encoding)
voidsetForcedBinaryDiff(boolean forced)
protected booleanuseLocalFileSeparatorChar()

Field Detail

EMPTY_FILE_IS

protected static final InputStream EMPTY_FILE_IS

EOL

protected static final byte[] EOL

HEADER_SEPARATOR

protected static final byte[] HEADER_SEPARATOR

PROPERTIES_SEPARATOR

protected static final byte[] PROPERTIES_SEPARATOR

WC_REVISION_LABEL

protected static final String WC_REVISION_LABEL

Constructor Detail

DefaultSVNDiffGenerator

public DefaultSVNDiffGenerator()
Constructs a DefaultSVNDiffGenerator.

Method Detail

createTempDirectory

public File createTempDirectory()

displayAddedDirectory

public void displayAddedDirectory(String path, String rev1, String rev2)
Does nothing.

Parameters: path a directory path rev1 the first diff revision rev2 the second diff revision

Throws: SVNException

displayBinary

protected void displayBinary(OutputStream os, String mimeType1, String mimeType2)

displayDeletedDirectory

public void displayDeletedDirectory(String path, String rev1, String rev2)
Does nothing.

Parameters: path a directory path rev1 the first diff revision rev2 the second diff revision

Throws: SVNException

displayFileDiff

public void displayFileDiff(String path, File file1, File file2, String rev1, String rev2, String mimeType1, String mimeType2, OutputStream result)

displayHeader

protected boolean displayHeader(OutputStream os, String path, boolean deleted)

displayHeaderFields

protected void displayHeaderFields(OutputStream os, String path1, String rev1, String path2, String rev2)

displayPropDiff

public void displayPropDiff(String path, Map baseProps, Map diff, OutputStream result)

getBasePath

protected File getBasePath()

getDiffOptions

public SVNDiffOptions getDiffOptions()
Gets the diff options that are used by this generator. Creates a new one if none was used before.

Returns: diff options

getDisplayPath

protected String getDisplayPath(String path)

getEncoding

public String getEncoding()

init

public void init(String anchorPath1, String anchorPath2)

isDiffAdded

public boolean isDiffAdded()

isDiffCopied

public boolean isDiffCopied()

isDiffDeleted

public boolean isDiffDeleted()

isDiffUnversioned

public boolean isDiffUnversioned()
Says if unversioned files are also diffed or ignored.

By default unversioned files are ignored.

Returns: true if diffed, false if ignored

See Also:

isForcedBinaryDiff

public boolean isForcedBinaryDiff()

isHeaderForced

protected boolean isHeaderForced(File file1, File file2)

setBasePath

public void setBasePath(File basePath)

setDiffAdded

public void setDiffAdded(boolean isDiffAdded)

setDiffCopied

public void setDiffCopied(boolean isDiffCopied)

setDiffDeleted

public void setDiffDeleted(boolean isDiffDeleted)

setDiffOptions

public void setDiffOptions(SVNDiffOptions options)
Sets diff options containing diff rules.

Parameters: options diff options

setDiffUnversioned

public void setDiffUnversioned(boolean diffUnversioned)
Includes or not unversioned files into diff processing.

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.

Parameters: diffUnversioned controls whether to diff unversioned files or not

See Also: isDiffUnversioned

setEncoding

public void setEncoding(String encoding)

setForcedBinaryDiff

public void setForcedBinaryDiff(boolean forced)

useLocalFileSeparatorChar

protected boolean useLocalFileSeparatorChar()
Copyright © 2004-2007 TMate Software Ltd. All Rights Reserved.