Package org.tmatesoft.svn.core.wc

# Class SVNMergeFileSet

java.lang.Object
org.tmatesoft.svn.core.wc.SVNMergeFileSet

public class SVNMergeFileSet extends Object
The SVNMergeFileSet class holds information about the file that is to be merged. This information includes references to `File` objects with working, base, repository contents; file mimeType; labels to append to the file name to produce conflict files in case a merge fails with a conflict, and so on.

Since:
  1.2
Version:
  1.3
Author:
  TMate Software Ltd.

## Constructor Summary

Constructors
Constructor
Description
`SVNMergeFileSet(org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea adminArea, org.tmatesoft.svn.core.internal.wc.admin.SVNLog log, File baseFile, File localFile, String wcPath, File reposFile, File resultFile, File copyFromFile, String mimeType)`
Creates a new `SVNMergeFileSet` object given the data prepared for merging a file.

## Method Summary

Modifier and Type
Method
Description
`void`
`dispose()`
Disposes this object.
`org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea`
`getAdminArea()`
Returns the admin area which controls the file.
`File`
`getBaseFile()`
Returns the file containing the pristine file contents.
`String`
`getBaseLabel()`
Returns the base file label.
`String`
`getBasePath()`
Returns the base file path.
`File`
`getCopyFromFile()`
Returns the file which is the copy source for the file being merged.
`String`
`getCopyFromPath()`
Returns the copy source path.
`File`
`getLocalFile()`
Returns the detranslated working copy file.
`String`
`getLocalLabel()`
Returns the local file label.
`String`
`getLocalPath()`
Returns the path of the detranslated version of the working copy file.
`org.tmatesoft.svn.core.internal.wc.admin.SVNLog`
`getLog()`
Returns the log object.
`String`
`getMimeType()`
Returns the mime type of the file.
`File`
`getRepositoryFile()`
Returns the repository version of the file.
`String`
`getRepositoryLabel()`
Returns the repository file label.
`String`
`getRepositoryPath()`
Returns the path to the file containing the contents of the repository version of the file.
`File`
`getResultFile()`
Returns the file where the merged resultant text is written to.
`String`
`getResultPath()`
Returns the path of the file where the merged resultant text is written to.
`File`
`getWCFile()`
Returns the working copy file as it presents in the working copy.
`String`
`getWCPath()`
Returns the path of the working copy file.
`boolean`
`isBinary()`
Tells whether this file is binary or textual.
`void`
`setMergeLabels(String baseLabel, String localLabel, String repositoryLabel)`
Sets the labels for conflict files.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SVNMergeFileSet

public SVNMergeFileSet(org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea adminArea, org.tmatesoft.svn.core.internal.wc.admin.SVNLog log, File baseFile, File localFile, String wcPath, File reposFile, File resultFile, File copyFromFile, String mimeType)
Creates a new `SVNMergeFileSet` object given the data prepared for merging a file.

Note: This is intended for internal use only, not for API users.

Parameters:
  `adminArea` - admin area the file is controlled under
  `log` - log object
  `baseFile` - file with pristine contents
  `localFile` - file with translated working contents
  `wcPath` - working copy path relative to the location of `adminArea`
  `reposFile` - file contents from the repository
  `resultFile` - file where the resultant merged contents will be written to
  `copyFromFile` - contents of the copy source file (if any)
  `mimeType` - file mime type

## Method Details

### setMergeLabels

public void setMergeLabels(String baseLabel, String localLabel, String repositoryLabel)
Sets the labels for conflict files.

If `baseLabel` is null, ".old" will be set by default. If `localLabel` is null, ".working" will be set by default. If `repositoryLabel` is null, ".new" will be set by default.

Parameters:
  `baseLabel` - base file label
  `localLabel` - working file label
  `repositoryLabel` - repository file label

### getLog

public org.tmatesoft.svn.core.internal.wc.admin.SVNLog getLog()
Returns the log object.

Note: This is intended for internal use only, not for API users.

Returns:
  wc modification commands logger

### getBaseLabel

public String getBaseLabel()
Returns the base file label.

Returns:
  base label string

### getLocalLabel

public String getLocalLabel()
Returns the local file label.

Returns:
  working file label

### getRepositoryLabel

public String getRepositoryLabel()
Returns the repository file label.

Returns:
  label of the repository file version

### getBasePath

public String getBasePath() throws SVNException
Returns the base file path.

If the `base file` is located under the `admin area`, then the return path will be just a relevant to the admin area path of the base file. Otherwise (in case the repository file is located not under the admin area) this method will create a temporary file in the `.svn/tmp` area of the admin area and copy the contents of the base file into it; the return path will be again relative to the location of the admin area.

Returns:
  path of the file with pristine contents
Throws:
  `SVNException`

### getLocalPath

public String getLocalPath()
Returns the path of the detranslated version of the working copy file. Detranslating of a working copy file takes place in case it's a symlink, or it has keywords or eol-style properties set on it.

Returns:
  path to the file with detranslated working contents; it's relevant to the `admin area` location

### getWCPath

public String getWCPath()
Returns the path of the working copy file.

Returns:
  path of the working copy file; it's relevant to the `admin area` location

### getRepositoryPath

public String getRepositoryPath() throws SVNException
Returns the path to the file containing the contents of the repository version of the file.

If the `repository file` is located under the `admin area`, then the return path will be just a relevant to the admin area path of the repository file. Otherwise (in case the repository file is located not under the admin area) this method will create a temporary file in the `.svn/tmp` area of the admin area and copy the contents of the repository file into it; the return path will be again relative to the location of the admin area.

Returns:
  path of the file containing file contents that come from the repository
Throws:
  `SVNException`

### getResultPath

public String getResultPath()
Returns the path of the file where the merged resultant text is written to.

Returns:
  path of the result file; it's relevant to the `admin area` location

### getBaseFile

public File getBaseFile()
Returns the file containing the pristine file contents.

Returns:
  base file

### getWCFile

public File getWCFile()
Returns the working copy file as it presents in the working copy.

Returns:
  working copy file

### getLocalFile

public File getLocalFile()
Returns the detranslated working copy file. Detranslating of a working copy file takes place in case it's a symlink, or it has keywords or eol-style properties set on it.

Returns:
  detranslated working copy file

### getRepositoryFile

public File getRepositoryFile()
Returns the repository version of the file.

Returns:
  repository file

### getResultFile

public File getResultFile()
Returns the file where the merged resultant text is written to.

Returns:
  merge result file

### isBinary

public boolean isBinary()
Tells whether this file is binary or textual. The result will depend on the value of the file `mime type`.

Returns:
  true if binary

### getMimeType

public String getMimeType()
Returns the mime type of the file.

Returns:
  file mime type

### getAdminArea

public org.tmatesoft.svn.core.internal.wc.admin.SVNAdminArea getAdminArea()
Returns the admin area which controls the file.

Note: this method is not intended for API users.

Returns:
  admin area

### dispose

public void dispose() throws SVNException
Disposes this object.

Note: this method is not intended for API users.

Throws:
  `SVNException`

### getCopyFromFile

public File getCopyFromFile()
Returns the file which is the copy source for the file being merged.

Returns:
  copy source file

### getCopyFromPath

public String getCopyFromPath()
Returns the copy source path.

Returns:
  path of the copy source file; it's relevant to the `admin area` location
Since:
  1.3