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
)
public FileSyncProvider (
String rootDirectoryPath,
FileSyncScopeFilter scopeFilter,
FileSyncOptions fileSyncOptions,
String metadataDirectoryPath,
String metadataFileName,
String tempDirectoryPath,
String pathToSaveConflictLoserFiles
)
public function FileSyncProvider (
rootDirectoryPath : String,
scopeFilter : FileSyncScopeFilter,
fileSyncOptions : FileSyncOptions,
metadataDirectoryPath : String,
metadataFileName : String,
tempDirectoryPath : String,
pathToSaveConflictLoserFiles : String
)
Parameters
- rootDirectoryPath
The absolute path to the local file store for this provider. This is the folder that contains the files and subfolders to be synchronized.
- scopeFilter
A static scope filter that specifies which files or directories in the local file store are included in the scope. Can be a null reference (Nothing in Visual Basic).
- fileSyncOptions
Flags that determine the behavior of the provider during synchronization.
- metadataDirectoryPath
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
The name of the metadata storage file.
- tempDirectoryPath
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
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 type | Condition |
---|---|
rootDirectoryPath is a null reference (Nothing in Visual Basic). |
|
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. |
|
fileSyncOptions is not in the FileSyncOptions enumeration. |
|
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 Members
Microsoft.Synchronization.Files Namespace