Share via


FileSyncProvider Constructor (Guid, String, FileSyncScopeFilter, FileSyncOptions, String, String, String, String)

Initializes a new instance of the FileSyncProvider class that is based on the specified replica ID, root directory path, scope filter, configuration options, metadata storage file path, metadata storage file name, temporary file path, and path to store conflict loser files.

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

Syntax

'Declaration
Public Sub New ( _
    replicaId As Guid, _
    rootDirectoryPath As String, _
    scopeFilter As FileSyncScopeFilter, _
    fileSyncOptions As FileSyncOptions, _
    metadataDirectoryPath As String, _
    metadataFileName As String, _
    tempDirectoryPath As String, _
    pathToSaveConflictLoserFiles As String _
)
'Usage
Dim replicaId As Guid
Dim rootDirectoryPath As String
Dim scopeFilter As FileSyncScopeFilter
Dim fileSyncOptions As FileSyncOptions
Dim metadataDirectoryPath As String
Dim metadataFileName As String
Dim tempDirectoryPath As String
Dim pathToSaveConflictLoserFiles As String

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

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.
  • metadataDirectoryPath
    Type: System.String
    The absolute path to the metadata storage file. The directory must be created before calling this constructor. The application must ensure this directory is secured with the right level of security permissions to prevent information disclosure.
  • metadataFileName
    Type: System.String
    The name of the metadata storage file.
  • tempDirectoryPath
    Type: System.String
    The absolute path where temporary files will be stored. The directory must be created before calling this constructor. The application must ensure this directory is secured with the right level of security permissions to prevent information disclosure.
  • pathToSaveConflictLoserFiles
    Type: System.String
    The absolute path where files that are conflict losers will be stored. The directory must be created before calling this constructor. To help prevent information disclosure, the application must ensure that this directory is secured with the appropriate level of security permissions. Can be a null reference (Nothing in Visual Basic).

Exceptions

Exception Condition
ArgumentNullException

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

ArgumentException

replicaId is Empty; rootDirectoryPath, metadataDirectoryPath, metadataFileName, tempDirectoryPath, or pathToSaveConflictLoserFiles is 0 length; rootDirectoryPath, metadataDirectoryPath, metadataFileName, tempDirectoryPath, or pathToSaveConflictLoserFiles contains wildcards; or rootDirectoryPath, metadataDirectoryPath, tempDirectoryPath, or pathToSaveConflictLoserFiles 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.

See Also

Reference

FileSyncProvider Class

FileSyncProvider Overload

Microsoft.Synchronization.Files Namespace