Share via


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

Initializes a new instance of the FileSyncProvider class that is based on the specified 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 ( _
    rootDirectoryPath As String, _
    scopeFilter As FileSyncScopeFilter, _
    fileSyncOptions As FileSyncOptions, _
    metadataDirectoryPath As String, _
    metadataFileName As String, _
    tempDirectoryPath As String, _
    pathToSaveConflictLoserFiles As String _
)
'Usage
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(rootDirectoryPath, _
    scopeFilter, fileSyncOptions, metadataDirectoryPath, _
    metadataFileName, tempDirectoryPath, _
    pathToSaveConflictLoserFiles)
public FileSyncProvider(
    string rootDirectoryPath,
    FileSyncScopeFilter scopeFilter,
    FileSyncOptions fileSyncOptions,
    string metadataDirectoryPath,
    string metadataFileName,
    string tempDirectoryPath,
    string pathToSaveConflictLoserFiles
)
public:
FileSyncProvider(
    String^ rootDirectoryPath, 
    FileSyncScopeFilter^ scopeFilter, 
    FileSyncOptions fileSyncOptions, 
    String^ metadataDirectoryPath, 
    String^ metadataFileName, 
    String^ tempDirectoryPath, 
    String^ pathToSaveConflictLoserFiles
)
new : 
        rootDirectoryPath:string * 
        scopeFilter:FileSyncScopeFilter * 
        fileSyncOptions:FileSyncOptions * 
        metadataDirectoryPath:string * 
        metadataFileName:string * 
        tempDirectoryPath:string * 
        pathToSaveConflictLoserFiles:string -> FileSyncProvider
public function FileSyncProvider(
    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

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.

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.

See Also

Reference

FileSyncProvider Class

FileSyncProvider Overload

Microsoft.Synchronization.Files Namespace