The file synchronization provider is a component of Sync Framework that helps an application synchronize files, folders, and subfolders in NTFS, FAT, or SMB file systems. The directories to synchronize can be local or remote and do not have to be of the same file system. Static filters can be used to exclude or include files either by listing them explicitly or by using wildcard characters, such as *.txt; or filters can be set that exclude individual subfolders. Progress reports can be obtained by registering to receive notifications during synchronization.
The centerpiece of the service is FileSyncProvider. Because it implements KnowledgeSyncProvider, the file synchronization provider only has to be created, initialized, and passed to a SyncAgent to perform synchronization.
A static filter is represented by FileSyncScopeFilter and can be used for finer control over which files or folders participate in synchronization.
Several events are available from the file synchronization provider, such as AppliedChange and CopyingFile. An application can register to receive notifications from any of these events. This enables the application to show synchronization progress to the user or take some other action.
The file synchronization provider uses the metadata storage service to store all synchronization metadata in a lightweight database. The metadata database is a single file. This file can be stored with the files and folders to be synchronized or in another location that is specified when the provider is initialized. For more information, see Sync Framework Metadata Storage Service.
For more information about how to use the file synchronization provider, see Synchronizing Files.
|AppliedChangeEventArgs||Provides data for the AppliedChange event.|
|ApplyingChangeEventArgs||Provides data for the ApplyingChange event.|
|CopyingFileEventArgs||Provides data for the CopyingFile event.|
|DetectedChangesEventArgs||Provides data for the DetectedChanges event.|
|DetectingChangesEventArgs||Provides data for the DetectingChanges event.|
|FileData||Represents information about a file or directory. This is a loose wrapper of the WIN32_FIND_DATA structure that contains additional path information.|
|FileSyncInvalidOperationException||The exception that is thrown when a method call is invalid for the current state of the object.|
|FileSyncProvider||Is a synchronous synchronization provider that can be used to synchronize files, folders, and subfolders in NTFS, FAT, or SMB file systems.|
|FileSyncScopeFilter||Defines filters that can be used to include or exclude files and folders from the static synchronization scope.|
|SkippedChangeEventArgs||Provides data for the SkippedChange event.|
|SkippedFileDetectEventArgs||Provides data for the SkippedFileDetect event.|
|IFileDataRetriever||Represents the mechanism by which a file synchronization provider and a custom provider transfer data between each other.|
|ChangeType||Represents the different types of changes that can be applied to a destination replica.|
|FileSyncOptions||Provides options to configure the behavior of the file synchronization provider.|
|SkipReason||Represents the reason why a file was skipped during change detection or change application.|