C# Class CmisSync.Lib.Sync.CmisRepo.SynchronizedFolder

Synchronization with a particular CMIS folder.
Afficher le fichier Open project: aegif/CmisSync Class Usage Examples

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Dispose pattern implementation.

Private Methods

Méthode Description
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

Method Details

ApplyAddedFiles() public méthode

Apply: Added files.
public ApplyAddedFiles ( List &addedFiles ) : bool
addedFiles List
Résultat bool

ApplyAddedFolders() public méthode

Apply: Added folders.
public ApplyAddedFolders ( List &addedFolders ) : bool
addedFolders List
Résultat bool

ApplyDeletedFiles() public méthode

Apply: Deleted files.
public ApplyDeletedFiles ( List &deletedFiles ) : bool
deletedFiles List
Résultat bool

ApplyDeletedFolders() public méthode

Apply: Deleted folders.
public ApplyDeletedFolders ( List &deletedFolders ) : bool
deletedFolders List
Résultat bool

ApplyLocalChanges() public méthode

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"
Résultat bool

ApplyModifiedFiles() public méthode

Apply: Modified files.
public ApplyModifiedFiles ( List &modifiedFiles ) : bool
modifiedFiles List
Résultat bool

CancelSync() public méthode

Cancel a running sync (does nothing if sync thread is stopped).
public CancelSync ( ) : void
Résultat void

Connect() public méthode

Connect to the CMIS repository.
public Connect ( ) : void
Résultat void

DeleteRemoteDocument() public méthode

public DeleteRemoteDocument ( IDocument remoteDocument, SyncItem syncItem ) : void
remoteDocument IDocument
syncItem CmisSync.Lib.SyncItem
Résultat void

DeleteRemoteFolder() public méthode

Delete the folder from the remote server.
public DeleteRemoteFolder ( IFolder folder, SyncItem syncItem, string upperFolderPath ) : void
folder IFolder
syncItem CmisSync.Lib.SyncItem
upperFolderPath string
Résultat void

Dispose() public méthode

Implement IDisposable interface.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Dispose pattern implementation.
protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

FindModifiedOrDeletedLocalObjects() public méthode

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
Résultat void

FindNewLocalObjects() public méthode

Check for added folders and files.
public FindNewLocalObjects ( string folder, List &addedFolders, List &addedFiles ) : void
folder string
addedFolders List
addedFiles List
Résultat void

ForceFullSync() public méthode

Forces the full sync independent of FS events or Remote events.
public ForceFullSync ( ) : void
Résultat void

ForceFullSyncAtNextSync() public méthode

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
Résultat void

IsSyncing() public méthode

Synchronize between CMIS folder and local folder.
public IsSyncing ( ) : bool
Résultat bool

Sync() public méthode

Synchronize between CMIS folder and local folder.
public Sync ( ) : void
Résultat void

Sync() public méthode

Synchronize between CMIS folder and local folder.
public Sync ( bool syncFull ) : void
syncFull bool
Résultat void

SyncComplete() public méthode

Synchronize has completed.
public SyncComplete ( bool syncFull ) : void
syncFull bool
Résultat void

SyncInBackground() public méthode

Sync in the background.
public SyncInBackground ( bool syncFull ) : void
syncFull bool
Résultat void

SyncInNotBackground() public méthode

Sync on the current thread.
public SyncInNotBackground ( bool syncFull ) : void
syncFull bool
Résultat void

SynchronizedFolder() public méthode

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
Résultat CmisSync.Lib.Cmis

UpdateSettings() public méthode

Update Settings.
public UpdateSettings ( RepoInfo repoInfo ) : void
repoInfo CmisSync.Lib.RepoInfo
Résultat void

isSuspended() public méthode

Whether this folder's synchronization is suspended right now.
public isSuspended ( ) : bool
Résultat bool

isSyncing() public méthode

Whether this folder's synchronization is running right now.
public isSyncing ( ) : bool
Résultat bool

resetFailedOperationsCounter() public méthode

Resets all the failed upload to zero.
public resetFailedOperationsCounter ( ) : void
Résultat void