com.microsoft.tfs.core.clients.versioncontrol
Class ResolutionOptions

java.lang.Object
  extended by com.microsoft.tfs.core.clients.versioncontrol.ResolutionOptions

public final class ResolutionOptions
extends java.lang.Object

Contains options that affect conflict resolution.

Since:
TEE-SDK-10.1
Thread-safety:
thread-compatible

Nested Class Summary
static class ResolutionOptions.EncodingStrategy
           
 
Constructor Summary
ResolutionOptions()
          Creates a ResolutionOptions with the default options set.
 
Method Summary
 FileEncoding getAcceptMergeEncoding()
          Gets the encoding to use when an AcceptMerge resolution is desired but there is a conflicting pending encoding change.
 PropertyValue[] getAcceptMergeProperties()
          When a conflict is to be resolved with the AcceptMerge resolution and there is a conflicting pending property change, this property contains the desired properties.
 ResolutionOptions.EncodingStrategy getEncodingStrategy()
          Gets the encoding resolution strategy.
 FileEncoding getExplicitEncoding()
          Gets the explicit encoding set previously as part of setting an encoding strategy.
 java.lang.String getNewPath()
          Gets the new path to use for this resolution.
 boolean isAcceptMergeWithConflicts()
           
 void setAcceptMergeEncoding(FileEncoding encoding)
          When a conflict is to be resolved with the AcceptMerge resolution and there is a conflicting pending encoding change, the given encoding will be used (no file conversion is done).
 void setAcceptMergeProperties(PropertyValue[] acceptMergeProperties)
           
 void setAcceptMergeWithConflicts(boolean mergeWithConflicts)
          Sets the option to accept (resolve a conflict) when the merge resulted in conflicts.
 void setEncodingStrategy(ResolutionOptions.EncodingStrategy strategy, FileEncoding explicitEncoding)
          Sets the strategy for resolving encoding conflicts.
 void setNewPath(java.lang.String newPath)
          Sets the new path for a conflicted item or the item in its way when it needs needs to move to a new location.
 void setUseInternalEngine(boolean useInternalEngine)
           
 boolean useInternalEngine()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResolutionOptions

public ResolutionOptions()
Creates a ResolutionOptions with the default options set.

Method Detail

setEncodingStrategy

public void setEncodingStrategy(ResolutionOptions.EncodingStrategy strategy,
                                FileEncoding explicitEncoding)
Sets the strategy for resolving encoding conflicts. If the strategy is EncodingStrategy.DEFAULT, explicitEncoding must be null. If the strategy is some other value, explicitEncoding must be non-null, and represents the overriding encoding, or conversion encoding, or whatever that strategy's comment says it represents.

Parameters:
strategy - the strategy to take for resolving encoding conflicts.
explicitEncoding - the encoding to use for resolving conflicts (null if the strategy is EncodingStrategy.DEFAULT).

getEncodingStrategy

public ResolutionOptions.EncodingStrategy getEncodingStrategy()
Gets the encoding resolution strategy. If the returned strategy is not EncodingStrategy.DEFAULT, call getExplicitEncoding() to get the encoding to be used for the strategy.

Returns:
the encoding resolution strategy.

getExplicitEncoding

public FileEncoding getExplicitEncoding()
Gets the explicit encoding set previously as part of setting an encoding strategy.

Returns:
the encoding to use as part of the encoding resolution strategy, null if not set or if the strategy was EncodingStrategy.DEFAULT.

setUseInternalEngine

public void setUseInternalEngine(boolean useInternalEngine)

useInternalEngine

public boolean useInternalEngine()

setAcceptMergeEncoding

public void setAcceptMergeEncoding(FileEncoding encoding)
When a conflict is to be resolved with the AcceptMerge resolution and there is a conflicting pending encoding change, the given encoding will be used (no file conversion is done). If the given encoding is null, the conflict will not be resolved.

Parameters:
encoding - the encoding to use when an automatic merge is desired and there is a conflicting pending change.

getAcceptMergeEncoding

public FileEncoding getAcceptMergeEncoding()
Gets the encoding to use when an AcceptMerge resolution is desired but there is a conflicting pending encoding change. If null is returned, the encoding should be unchanged.

Returns:
the encoding to use to resolve the case where AcceptMerge must operate on a file with a conflicting pending encoding change, null if the encoding should be unchanged.

getAcceptMergeProperties

public PropertyValue[] getAcceptMergeProperties()
When a conflict is to be resolved with the AcceptMerge resolution and there is a conflicting pending property change, this property contains the desired properties. If this property is left as null, the conflict will not be resolved.


setAcceptMergeProperties

public void setAcceptMergeProperties(PropertyValue[] acceptMergeProperties)

setNewPath

public void setNewPath(java.lang.String newPath)
Sets the new path for a conflicted item or the item in its way when it needs needs to move to a new location. This may happen in cases like these: Merge conflict with AcceptMerge chosen, and there's a conflicting pending rename: set the desired name. If null, the conflict will not be resolved. Namespace conflict with AcceptTheirs: set the path that would describe their item. Namespace conflict with AcceptYours: set to the path of the local item that was in the way of the server item.

Parameters:
newPath - the path to use for this conflict resolution, null to defer the resolution in the cases documented above.

getNewPath

public java.lang.String getNewPath()
Gets the new path to use for this resolution. See setNewPath() comments for details.

Returns:
the new path, null if not set.

isAcceptMergeWithConflicts

public boolean isAcceptMergeWithConflicts()
Returns:
true if a merge should be resolved when conflicts remain in the file, false if the merge should not be resolved when conflicts remain

setAcceptMergeWithConflicts

public void setAcceptMergeWithConflicts(boolean mergeWithConflicts)
Sets the option to accept (resolve a conflict) when the merge resulted in conflicts.

Parameters:
mergeWithConflicts - true if a merge should be resolved when conflicts remain in the file, false if the merge should not be resolved when conflicts remain


© 2015 Microsoft. All rights reserved.