com.microsoft.tfs.core.clients.versioncontrol.offline
Class OfflineSynchronizer

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

public class OfflineSynchronizer
extends java.lang.Object

OfflineSynchronizer examines a mapped folder for changes that are not reflected on the server side. Changes that are found locally (by examining writable files or differences, additions or deletions) will be pended to the server.

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

Constructor Summary
OfflineSynchronizer(Workspace workspace, OfflineSynchronizerProvider provider)
          Takes an OfflineSynchronizerProvider which provides local paths to resources to examine.
OfflineSynchronizer(Workspace workspace, OfflineSynchronizerProvider provider, OfflineSynchronizerFilter filter)
          Takes an OfflineSynchronizerProvider which provides local paths to resources to examine.
 
Method Summary
 int detectChanges()
          Returns online for the set of resources.
 OfflineChange[] getChanges()
          Gets the detected offline changes.
 void setDetectAdded(boolean detectAdded)
          Toggle whether files added locally (ie, those which exist on the local filesystem but do not exist on the server) will have adds pended for them.
 void setDetectDeleted(boolean detectDeleted)
          Toggle whether files deleted locally (ie, those which do not exist on the local filesystem but the server expects that we have them) will have deletes pended for them.
 void setFilter(OfflineSynchronizerFilter filter)
          Sets the resource filter used to check resources before pending changes.
 void setMethod(OfflineSynchronizerMethod method)
          Sets the method of edited file detection.
 void setRecursionType(RecursionType recursionType)
          Sets the recursion for this operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OfflineSynchronizer

public OfflineSynchronizer(Workspace workspace,
                           OfflineSynchronizerProvider provider)
Takes an OfflineSynchronizerProvider which provides local paths to resources to examine.

Parameters:
workspace - an AWorkspace holding the mapped resources
provider - provider of local paths for synchronization

OfflineSynchronizer

public OfflineSynchronizer(Workspace workspace,
                           OfflineSynchronizerProvider provider,
                           OfflineSynchronizerFilter filter)
Takes an OfflineSynchronizerProvider which provides local paths to resources to examine.

Parameters:
workspace - an AWorkspace holding the mapped resources
provider - provider of local paths for synchronization
filter - a filter which can limit resources to be pended
Method Detail

setDetectAdded

public void setDetectAdded(boolean detectAdded)
Toggle whether files added locally (ie, those which exist on the local filesystem but do not exist on the server) will have adds pended for them.

Parameters:
detectAdded - true to pend adds, false to ignore added resources

setDetectDeleted

public void setDetectDeleted(boolean detectDeleted)
Toggle whether files deleted locally (ie, those which do not exist on the local filesystem but the server expects that we have them) will have deletes pended for them.

Parameters:
detectDeleted - true to pend deletes, false to ignore deleted resources

setFilter

public void setFilter(OfflineSynchronizerFilter filter)
Sets the resource filter used to check resources before pending changes.

Parameters:
filter - filter to check before pending resource changes

setMethod

public void setMethod(OfflineSynchronizerMethod method)
Sets the method of edited file detection.

Parameters:
method - method of file detection

setRecursionType

public void setRecursionType(RecursionType recursionType)
Sets the recursion for this operation.

Parameters:
recursionType - how deep to recurse for the named paths

getChanges

public OfflineChange[] getChanges()
Gets the detected offline changes.

Returns:
a List of OfflineChange objects

detectChanges

public final int detectChanges()
                        throws java.lang.Exception
Returns online for the set of resources.

Returns:
The number of changes to be pended to the server
Throws:
java.lang.Exception - if there was an error communicating with the server
CanceledException - if the task monitor was cancelled


© 2015 Microsoft. All rights reserved.