C# Класс CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder

Synchronization with a particular CMIS folder.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ApplyAddedFiles ( List &addedFiles ) : bool

Apply: Added files.

ApplyAddedFolders ( List &addedFolders ) : bool

Apply: Added folders.

ApplyDeletedFiles ( List &deletedFiles ) : bool

Apply: Deleted files.

ApplyDeletedFolders ( List &deletedFolders ) : bool

Apply: Deleted folders.

ApplyLocalChanges ( string rootFolder ) : bool

Detect what has changed using the local database, and apply these modifications to the remote server.

ApplyModifiedFiles ( List &modifiedFiles ) : bool

Apply: Modified files.

CancelSync ( ) : void

Cancel a running sync (does nothing if sync thread is stopped).

Connect ( ) : void

Connect to the CMIS repository.

DeleteRemoteDocument ( IDocument remoteDocument, SyncItem syncItem ) : void
DeleteRemoteFolder ( IFolder folder, SyncItem syncItem, string upperFolderPath ) : void

Delete the folder from the remote server.

Dispose ( ) : void

Implement IDisposable interface.

FindModifiedOrDeletedLocalObjects ( String rootFolder, List &deletedFolders, List &deletedFiles, List &modifiedFiles ) : void

Check for deleted and modified folders and files.

FindNewLocalObjects ( string folder, List &addedFolders, List &addedFiles ) : void

Check for added folders and files.

ForceFullSync ( ) : void

Forces the full sync independent of FS events or Remote events.

ForceFullSyncAtNextSync ( ) : void

Forces the full sync at next sync. This can be used to ensure a full sync if fs or remote events where lost.

IsSyncing ( ) : bool

Synchronize between CMIS folder and local folder.

Sync ( ) : void

Synchronize between CMIS folder and local folder.

Sync ( bool syncFull ) : void

Synchronize between CMIS folder and local folder.

SyncComplete ( bool syncFull ) : void

Synchronize has completed.

SyncInBackground ( bool syncFull ) : void

Sync in the background.

SyncInNotBackground ( bool syncFull ) : void

Sync on the current thread.

SynchronizedFolder ( RepoInfo repoInfo, RepoBase repo, IActivityListener activityListener ) : CmisSync.Lib.Cmis

Constructor for Repo (at every launch of CmisSync)

UpdateSettings ( RepoInfo repoInfo ) : void

Update Settings.

isSuspended ( ) : bool

Whether this folder's synchronization is suspended right now.

isSyncing ( ) : bool

Whether this folder's synchronization is running right now.

resetFailedOperationsCounter ( ) : void

Resets all the failed upload to zero.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Dispose pattern implementation.

Приватные методы

Метод Описание
ChangeLogThenCrawlSync ( IFolder remoteFolder, string remotePath, string localFolder ) : void

Synchronize using the ChangeLog feature of CMIS to trigger CrawlStrategy.

CheckInsideChange ( IFolder targetIFolder, IChangeEvents changeTokens ) : bool
CheckLocalFile ( string filePath, IFolder remoteFolder, IList remoteFiles ) : void

Check a local file in a given directory (not recursive).

CheckLocalFiles ( string localFolder, IFolder remoteFolder, IList remoteFiles ) : void

Crawl local files in a given directory (not recursive).

CheckLocalFolder ( string localSubFolder, IFolder remoteRoot, IList remoteFolders ) : void

Check a particular local folder (not recursive). See whether it has been deleted locally or not.

CheckLocalFolders ( string localFolder, IFolder remoteRoot, IList remoteFolders ) : void

Crawl local folders in a given directory (not recursive).

CrawlChangeLogSyncAndUpdateChangeLogToken ( IList changeLogs, IFolder remoteFolder, string remotePath, string localFolder ) : void

Apply CMIS ChangeLog changes.

CrawlCmisObject ( ICmisObject cmisObject ) : void

Synchronize changes made to a particular CMIS object.

CrawlRemote ( IFolder remoteFolder, string remotePath, string localFolder, IList remoteFiles, IList remoteFolders ) : bool

Crawl remote content, syncing down if needed. Meanwhile, cache remoteFiles and remoteFolders, they are output parameters that are used in CrawlLocalFiles/CrawlLocalFolders

CrawlRemoteDocument ( IDocument remoteDocument, string remotePath, string localFolder, IList remoteFiles ) : void

Check remote document, syncing down if needed. Meanwhile, cache remoteFiles, they are output parameters that are used in CrawlLocalFiles/CrawlLocalFolders

CrawlRemoteFolder ( IFolder remoteSubFolder, string remotePath, string localFolder, IList remoteFolders ) : void

Crawl remote subfolder, syncing down if needed. Meanwhile, cache all contained remote folders, they are output parameters that are used in CrawlLocalFiles/CrawlLocalFolders

CrawlSync ( IFolder remoteFolder, string remotePath, string localFolder ) : bool

Synchronize by checking all folders/files one-by-one. This strategy is used if the CMIS server does not support the ChangeLog feature. for all remote folders: if exists locally: recurse else if in database: delete recursively from server // if BIDIRECTIONAL else download recursively for all remote files: if exists locally: if remote is more recent than local: download else upload // if BIDIRECTIONAL else: if in database: delete from server // if BIDIRECTIONAL else download for all local files: if not present remotely: if in database: delete else: upload // if BIDIRECTIONAL else: if has changed locally: upload // if BIDIRECTIONAL for all local folders: if not present remotely: if in database: delete recursively from local else: upload recursively // if BIDIRECTIONAL

CrawlSyncAndUpdateChangeLogToken ( IFolder remoteFolder, string remotePath, string localFolder ) : void

Perform a crawl sync (check all folders and file checksums). If successful, update the local ChangeLog token.

DownloadDirectory ( IFolder remoteFolder, string remotePath, string localFolder ) : bool

Download a single folder from the CMIS server, by simple recursive copy.

DownloadFile ( IDocument remoteDocument, string remotePath, string localFolder ) : bool

Download a single file from the CMIS server. Algorithm: Skip if invalid filename If directory exists with same name, delete it If temporary file already exists but database has a different modification date than server, delete it Download data and metadata, return if that fails If a file with this name already exists locally If conflict Rename the existing file and put the server file instead Notify the user If file update Replace the file Else (new file) Save Set creation date and last modification date if available Make read-only if remote can not be modified Create CmisSync database entry for this file

DownloadStream ( DotCMIS contentStream, string filePath ) : byte[]

Download a file, without retrying.

FetchMetadata ( IDocument document ) : string[]>.Dictionary

Retrieve the CMIS metadata of a document.

HasFolderChanged ( IFolder deletedIFolder ) : bool
MoveFile ( string oldDirectory, string newDirectory, IFolder oldRemoteFolder, IFolder newRemoteFolder, IDocument remoteFile ) : bool

Move a file remotely.

MoveFolder ( string oldDirectory, string newDirectory, IFolder oldRemoteFolder, IFolder newRemoteFolder, IFolder remoteFolder ) : bool

Move a folder remotely.

PathIsApplicable ( string remotePath ) : bool

Check whether a path is relevant for the current synchronized folder.

ProcessRecoverableException ( string logMessage, Exception exception ) : void

Handle CMIS Exception.

RecursiveFolderCopy ( IFolder remoteFolder, string remotePath, string localFolder ) : void

Download all content from a CMIS folder.

RemoveFolderLocally ( string folderPath ) : bool

Remove folder from local filesystem and database.

RenameFile ( string directory, string newFilename, IDocument remoteFile ) : bool

Rename a file remotely.

RenameFolder ( string directory, string newFilename, IFolder remoteFolder ) : bool

Rename a folder remotely.

ResumeUploadFile ( string filePath, IDocument remoteDocument ) : bool
SetLastModifiedDate ( IDocument remoteDocument, string filepath, string[]>.Dictionary metadata ) : void

Set the last modification date of a local file to whatever a remote document's last modfication date is.

SetLastModifiedDate ( IFolder remoteFolder, string folderpath, string[]>.Dictionary metadata ) : void
SleepWhileSuspended ( ) : void

Sleep while suspended.

UpdateFile ( string localFilePath, IDocument remoteFile ) : bool

Upload new version of file.

UpdateFile ( string filePath, IFolder remoteFolder ) : bool

Upload new version of file content.

UploadFile ( string filePath, IFolder remoteFolder ) : bool

Upload a single file to the CMIS server.

UploadFolderRecursively ( IFolder remoteBaseFolder, string localFolder ) : bool

Upload folder recursively. After execution, the hierarchy on server will be: .../remoteBaseFolder/localFolder/...

WatchSyncMove ( string remoteFolder, string localFolder, string oldPathname, string newPathname, Grace grace ) : bool

An event was received from the filesystem watcher, analyze the change and apply it. Whether the move has now been synchronized, so that no further action is needed

WatcherSync ( string remoteFolder, string localFolder ) : bool

Synchronization based on local filesystem monitoring ("watcher").

WatcherSyncDelete ( string remoteFolder, string localFolder, string pathname, Grace grace ) : bool

Process a detected deletion.

WatcherSyncUpdate ( string remoteFolder, string localFolder, string localPath ) : bool

Sync update.

isLink ( ICmisObject cmisObject ) : bool

Описание методов

ApplyAddedFiles() публичный Метод

Apply: Added files.
public ApplyAddedFiles ( List &addedFiles ) : bool
addedFiles List
Результат bool

ApplyAddedFolders() публичный Метод

Apply: Added folders.
public ApplyAddedFolders ( List &addedFolders ) : bool
addedFolders List
Результат bool

ApplyDeletedFiles() публичный Метод

Apply: Deleted files.
public ApplyDeletedFiles ( List &deletedFiles ) : bool
deletedFiles List
Результат bool

ApplyDeletedFolders() публичный Метод

Apply: Deleted folders.
public ApplyDeletedFolders ( List &deletedFolders ) : bool
deletedFolders List
Результат bool

ApplyLocalChanges() публичный Метод

Detect what has changed using the local database, and apply these modifications to the remote server.
public ApplyLocalChanges ( string rootFolder ) : bool
rootFolder string Full path of the local synchronized folder, for instance "/User Homes/nicolas.raoul/demos"
Результат bool

ApplyModifiedFiles() публичный Метод

Apply: Modified files.
public ApplyModifiedFiles ( List &modifiedFiles ) : bool
modifiedFiles List
Результат bool

CancelSync() публичный Метод

Cancel a running sync (does nothing if sync thread is stopped).
public CancelSync ( ) : void
Результат void

Connect() публичный Метод

Connect to the CMIS repository.
public Connect ( ) : void
Результат void

DeleteRemoteDocument() публичный Метод

public DeleteRemoteDocument ( IDocument remoteDocument, SyncItem syncItem ) : void
remoteDocument IDocument
syncItem CmisSync.Lib.SyncItem
Результат void

DeleteRemoteFolder() публичный Метод

Delete the folder from the remote server.
public DeleteRemoteFolder ( IFolder folder, SyncItem syncItem, string upperFolderPath ) : void
folder IFolder
syncItem CmisSync.Lib.SyncItem
upperFolderPath string
Результат void

Dispose() публичный Метод

Implement IDisposable interface.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Dispose pattern implementation.
protected Dispose ( bool disposing ) : void
disposing bool
Результат void

FindModifiedOrDeletedLocalObjects() публичный Метод

Check for deleted and modified folders and files.
public FindModifiedOrDeletedLocalObjects ( String rootFolder, List &deletedFolders, List &deletedFiles, List &modifiedFiles ) : void
rootFolder String
deletedFolders List
deletedFiles List
modifiedFiles List
Результат void

FindNewLocalObjects() публичный Метод

Check for added folders and files.
public FindNewLocalObjects ( string folder, List &addedFolders, List &addedFiles ) : void
folder string
addedFolders List
addedFiles List
Результат void

ForceFullSync() публичный Метод

Forces the full sync independent of FS events or Remote events.
public ForceFullSync ( ) : void
Результат void

ForceFullSyncAtNextSync() публичный Метод

Forces the full sync at next sync. This can be used to ensure a full sync if fs or remote events where lost.
public ForceFullSyncAtNextSync ( ) : void
Результат void

IsSyncing() публичный Метод

Synchronize between CMIS folder and local folder.
public IsSyncing ( ) : bool
Результат bool

Sync() публичный Метод

Synchronize between CMIS folder and local folder.
public Sync ( ) : void
Результат void

Sync() публичный Метод

Synchronize between CMIS folder and local folder.
public Sync ( bool syncFull ) : void
syncFull bool
Результат void

SyncComplete() публичный Метод

Synchronize has completed.
public SyncComplete ( bool syncFull ) : void
syncFull bool
Результат void

SyncInBackground() публичный Метод

Sync in the background.
public SyncInBackground ( bool syncFull ) : void
syncFull bool
Результат void

SyncInNotBackground() публичный Метод

Sync on the current thread.
public SyncInNotBackground ( bool syncFull ) : void
syncFull bool
Результат void

SynchronizedFolder() публичный Метод

Constructor for Repo (at every launch of CmisSync)
public SynchronizedFolder ( RepoInfo repoInfo, RepoBase repo, IActivityListener activityListener ) : CmisSync.Lib.Cmis
repoInfo CmisSync.Lib.RepoInfo
repo CmisSync.Lib.RepoBase
activityListener IActivityListener
Результат CmisSync.Lib.Cmis

UpdateSettings() публичный Метод

Update Settings.
public UpdateSettings ( RepoInfo repoInfo ) : void
repoInfo CmisSync.Lib.RepoInfo
Результат void

isSuspended() публичный Метод

Whether this folder's synchronization is suspended right now.
public isSuspended ( ) : bool
Результат bool

isSyncing() публичный Метод

Whether this folder's synchronization is running right now.
public isSyncing ( ) : bool
Результат bool

resetFailedOperationsCounter() публичный Метод

Resets all the failed upload to zero.
public resetFailedOperationsCounter ( ) : void
Результат void