Share via


FileSyncProvider Constructor (String, FileSyncScopeFilter, FileSyncOptions)

Initializes a new instance of the FileSyncProvider class that is based on the specified root directory path, scope filter, and configuration options.

Namespace:  Microsoft.Synchronization.Files
Assembly:  Microsoft.Synchronization.Files (in Microsoft.Synchronization.Files.dll)

Syntax

'Declaration
Public Sub New ( _
    rootDirectoryPath As String, _
    scopeFilter As FileSyncScopeFilter, _
    fileSyncOptions As FileSyncOptions _
)
'Usage
Dim rootDirectoryPath As String
Dim scopeFilter As FileSyncScopeFilter
Dim fileSyncOptions As FileSyncOptions

Dim instance As New FileSyncProvider(rootDirectoryPath, _
    scopeFilter, fileSyncOptions)
public FileSyncProvider(
    string rootDirectoryPath,
    FileSyncScopeFilter scopeFilter,
    FileSyncOptions fileSyncOptions
)
public:
FileSyncProvider(
    String^ rootDirectoryPath, 
    FileSyncScopeFilter^ scopeFilter, 
    FileSyncOptions fileSyncOptions
)
new : 
        rootDirectoryPath:string * 
        scopeFilter:FileSyncScopeFilter * 
        fileSyncOptions:FileSyncOptions -> FileSyncProvider
public function FileSyncProvider(
    rootDirectoryPath : String, 
    scopeFilter : FileSyncScopeFilter, 
    fileSyncOptions : FileSyncOptions
)

Parameters

  • rootDirectoryPath
    Type: System.String
    The absolute path to the local file store for this provider. This is the folder that contains the files and subfolders to be synchronized.

Exceptions

Exception Condition
ArgumentNullException

rootDirectoryPath is a null reference (Nothing in Visual Basic).

ArgumentException

rootDirectoryPath is 0 length, rootDirectoryPath contains wildcards, or rootDirectoryPath does not exist.

ArgumentOutOfRangeException

fileSyncOptions is not in the FileSyncOptions enumeration.

ReplicaMetadataInUseException

Another provider instance was previously initialized with the same values for directory path and metadata file path, but has not yet been released.

Remarks

This form of the constructor can be used when the application does not use a replica ID to identify the replica. In this case, a replica ID is created and used by the object and stored in the metadata storage file.

This form of the constructor initializes the location of the metadata storage file and temporary files to be rootDirectoryPath. It initializes the path to save conflict loser files to a null reference (Nothing in Visual Basic). It names the metadata storage file filesync.metadata.

See Also

Reference

FileSyncProvider Class

FileSyncProvider Overload

Microsoft.Synchronization.Files Namespace