public async Task DownloadApplicationBinaries(AppIdentity appIdentity, string localPath, ConflictResolutionMode conflictResolutionMode) { bool exists = !FileUtils.DirectoryDoesntExistOrEmpty(localPath); if (exists) { if (conflictResolutionMode == ConflictResolutionMode.DoNothingIfBinariesExist) { return; } if (conflictResolutionMode == ConflictResolutionMode.FailIfBinariesExist) { throw new DuplicateBinariesException( $"Cannot download the binaries because the destination directory {localPath} contains files"); } } CloudBlobDirectory blobDirectory = GetBlobDirectory(appIdentity); if (!await blobDirectory.ExistsAsync()) { throw new BinariesNotFoundException("The binaries were not found in the Yams repository"); } await BlobUtils.DownloadBlobDirectory(blobDirectory, localPath); }
public async Task UploadApplicationBinaries(AppIdentity appIdentity, string localPath, ConflictResolutionMode conflictResolutionMode) { if (FileUtils.DirectoryDoesntExistOrEmpty(localPath)) { throw new BinariesNotFoundException( $"Binaries were not be uploaded because they were not found at the given path {localPath}"); } if (conflictResolutionMode == ConflictResolutionMode.OverwriteExistingBinaries) { await DeleteApplicationBinaries(appIdentity); } else { bool exists = await HasApplicationBinaries(appIdentity); if (exists) { if (conflictResolutionMode == ConflictResolutionMode.DoNothingIfBinariesExist) { return; } if (conflictResolutionMode == ConflictResolutionMode.FailIfBinariesExist) { throw new DuplicateBinariesException( $"Cannot override binaries when flag {ConflictResolutionMode.FailIfBinariesExist} is used"); } } } // at this point we know that it is either OverwriteExistingBinaries mode or the binaries don't exist await BlobUtils.UploadDirectory(localPath, _blobContainer, GetBlobDirectoryRelPath(appIdentity)); }
/// <summary> /// Update item. /// </summary> /// <param name="parentFolderId">The parent folder id.</param> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> /// <param name="messageDisposition">The message disposition.</param> /// <param name="sendInvitationsOrCancellationsMode">The send invitations or cancellations mode.</param> /// <param name="suppressReadReceipts">Whether to suppress read receipts</param> /// <returns>Updated item.</returns> internal Item InternalUpdate( FolderId parentFolderId, ConflictResolutionMode conflictResolutionMode, MessageDisposition?messageDisposition, SendInvitationsOrCancellationsMode?sendInvitationsOrCancellationsMode, bool suppressReadReceipts) { this.ThrowIfThisIsNew(); this.ThrowIfThisIsAttachment(); Item returnedItem = null; if (this.IsDirty && this.PropertyBag.GetIsUpdateCallNecessary()) { returnedItem = this.Service.UpdateItem( this, parentFolderId, conflictResolutionMode, messageDisposition, sendInvitationsOrCancellationsMode.HasValue ? sendInvitationsOrCancellationsMode : this.DefaultSendInvitationsOrCancellationsMode, suppressReadReceipts); } // Regardless of whether item is dirty or not, if it has unprocessed // attachment changes, validate them and process now. if (this.HasUnprocessedAttachmentChanges()) { this.Attachments.Validate(); this.Attachments.Save(); } return(returnedItem); }
/// <summary> /// Applies the local changes that have been made to this task. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param> /// <returns> /// A Task object representing the completed occurrence if the task is recurring and the update marks it as completed; or /// a Task object representing the current occurrence if the task is recurring and the uypdate changed its recurrence /// pattern; or null in every other case. /// </returns> public new Task Update(ConflictResolutionMode conflictResolutionMode) { return((Task)this.InternalUpdate( null /* parentFolder */, conflictResolutionMode, MessageDisposition.SaveOnly, null)); }
private static async Task UploadTestApplicationBinaries(ConflictResolutionMode conflictResolutionMode, string testFileContent) { string testDir = await CreateTestTempDirectory(nameof(UploadTestApplicationBinaries)); CreateTestFile(testDir, testFileContent); await _deploymentRepository.UploadApplicationBinaries(TestAppIdentity, testDir, conflictResolutionMode); }
/// <summary> /// Update item. /// </summary> /// <param name="parentFolderId">The parent folder id.</param> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> /// <param name="messageDisposition">The message disposition.</param> /// <param name="sendInvitationsOrCancellationsMode">The send invitations or cancellations mode.</param> /// <returns>Updated item.</returns> internal Item InternalUpdate( FolderId parentFolderId, ConflictResolutionMode conflictResolutionMode, MessageDisposition?messageDisposition, SendInvitationsOrCancellationsMode?sendInvitationsOrCancellationsMode) { return(this.InternalUpdate(parentFolderId, conflictResolutionMode, messageDisposition, sendInvitationsOrCancellationsMode, false)); }
/// <summary> /// Applies the local changes that have been made to this task. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param> /// <returns> /// A Task object representing the completed occurrence if the task is recurring and the update marks it as completed; or /// a Task object representing the current occurrence if the task is recurring and the uypdate changed its recurrence /// pattern; or null in every other case. /// </returns> public new async Task <Task> Update(ConflictResolutionMode conflictResolutionMode, CancellationToken token = default(CancellationToken)) { return((Task)await this.InternalUpdate( null /* parentFolder */, conflictResolutionMode, MessageDisposition.SaveOnly, null, token)); }
/// <summary> /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> /// <param name="suppressReadReceipts">Whether to suppress read receipts</param> public Task <Item> Update(ConflictResolutionMode conflictResolutionMode, bool suppressReadReceipts) { return(this.InternalUpdate( null /* parentFolder */, conflictResolutionMode, MessageDisposition.SaveOnly, null, suppressReadReceipts)); }
/// <summary> /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> /// <param name="suppressReadReceipts">Whether to suppress read receipts</param> public void Update(ConflictResolutionMode conflictResolutionMode, bool suppressReadReceipts) { this.InternalUpdate( null /* parentFolder */, conflictResolutionMode, MessageDisposition.SaveOnly, null, suppressReadReceipts); }
/// <summary> /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> /// <param name="suppressReadReceipts">Whether to suppress read receipts</param> public Task <Item> Update(ConflictResolutionMode conflictResolutionMode, bool suppressReadReceipts, CancellationToken token = default(CancellationToken)) { return(this.InternalUpdate( null /* parentFolder */, conflictResolutionMode, MessageDisposition.SaveOnly, null, suppressReadReceipts, token)); }
/// <summary> /// Applies the local changes that have been made to this appointment. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param> /// <param name="sendInvitationsOrCancellationsMode">Specifies if and how invitations or cancellations should be sent if this appointment is a meeting.</param> public void Update( ConflictResolutionMode conflictResolutionMode, SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode) { this.InternalUpdate( null, conflictResolutionMode, null, sendInvitationsOrCancellationsMode); }
/// <summary> /// Applies the local changes that have been made to this appointment. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param> /// <param name="sendInvitationsOrCancellationsMode">Specifies if and how invitations or cancellations should be sent if this appointment is a meeting.</param> public Task <Item> Update( ConflictResolutionMode conflictResolutionMode, SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode) { return(this.InternalUpdate( null, conflictResolutionMode, null, sendInvitationsOrCancellationsMode)); }
/// <summary> /// Applies the local changes that have been made to this appointment. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param> /// <param name="sendInvitationsOrCancellationsMode">Specifies if and how invitations or cancellations should be sent if this appointment is a meeting.</param> public Task <Item> Update( ConflictResolutionMode conflictResolutionMode, SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode, CancellationToken token = default(CancellationToken)) { return(this.InternalUpdate( null, conflictResolutionMode, null, sendInvitationsOrCancellationsMode, token)); }
public Task UploadApplicationBinaries(AppIdentity appIdentity, string localPath, ConflictResolutionMode conflictResolutionMode) { if (FileUtils.DirectoryDoesntExistOrEmpty(localPath)) { throw new BinariesNotFoundException( $"Binaries were not be uploaded because they were not found at the given path {localPath}"); } string destPath = GetBinariesPath(appIdentity); bool binariesExist = FileUtils.DirectoryDoesntExistOrEmpty(destPath); if (binariesExist) { if (conflictResolutionMode == ConflictResolutionMode.DoNothingIfBinariesExist) { return Task.CompletedTask; } if (conflictResolutionMode == ConflictResolutionMode.FailIfBinariesExist) { throw new DuplicateBinariesException(); } } return FileUtils.CopyDir(_path, localPath, true); }
public async Task DownloadApplicationBinaries(AppIdentity appIdentity, string localPath, ConflictResolutionMode conflictResolutionMode) { var exists = !FileUtils.DirectoryDoesntExistOrEmpty(localPath); if (exists) { if (conflictResolutionMode == ConflictResolutionMode.DoNothingIfBinariesExist) { return; } if (conflictResolutionMode == ConflictResolutionMode.FailIfBinariesExist) { throw new DuplicateBinariesException( $"Cannot download the binaries because the destination directory {localPath} contains files"); } } var path = GetBinariesPath(appIdentity); if (FileUtils.DirectoryDoesntExistOrEmpty(path)) { throw new BinariesNotFoundException($"The binaries were not found in the Yams repository"); } await FileUtils.CopyDir(path, localPath, true); }
public Task UploadApplicationBinaries(AppIdentity appIdentity, string localPath, ConflictResolutionMode conflictResolutionMode) { if (FileUtils.DirectoryDoesntExistOrEmpty(localPath)) { throw new BinariesNotFoundException( $"Binaries were not be uploaded because they were not found at the given path {localPath}"); } string destPath = GetBinariesPath(appIdentity); bool binariesExist = FileUtils.DirectoryDoesntExistOrEmpty(destPath); if (binariesExist) { if (conflictResolutionMode == ConflictResolutionMode.DoNothingIfBinariesExist) { return(Task.CompletedTask); } if (conflictResolutionMode == ConflictResolutionMode.FailIfBinariesExist) { throw new DuplicateBinariesException(); } } return(FileUtils.CopyDir(_path, localPath, true)); }
/// <summary> /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> public async System.Threading.Tasks.Task UpdateAsync(ConflictResolutionMode conflictResolutionMode) { await this.UpdateAsync(conflictResolutionMode, false); }
/// <summary> /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> public Task <Item> Update(ConflictResolutionMode conflictResolutionMode) { return(this.Update(conflictResolutionMode, false)); }
public SqlContainerImpl WithConflictResolutionProcedure(ConflictResolutionMode mode, string conflictResolutionProcedure) { return(this.WithConflictResolutionPolicy(new Models.ConflictResolutionPolicy(mode: mode, conflictResolutionProcedure: conflictResolutionProcedure))); }
/// <summary> /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> public void Update(ConflictResolutionMode conflictResolutionMode) { this.Update(conflictResolutionMode, false); }
/// <summary> /// Update item. /// </summary> /// <param name="parentFolderId">The parent folder id.</param> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> /// <param name="messageDisposition">The message disposition.</param> /// <param name="sendInvitationsOrCancellationsMode">The send invitations or cancellations mode.</param> /// <param name="suppressReadReceipts">Whether to suppress read receipts</param> /// <returns>Updated item.</returns> internal Item InternalUpdate( FolderId parentFolderId, ConflictResolutionMode conflictResolutionMode, MessageDisposition? messageDisposition, SendInvitationsOrCancellationsMode? sendInvitationsOrCancellationsMode, bool suppressReadReceipts) { this.ThrowIfThisIsNew(); this.ThrowIfThisIsAttachment(); Item returnedItem = null; if (this.IsDirty && this.PropertyBag.GetIsUpdateCallNecessary()) { returnedItem = this.Service.UpdateItem( this, parentFolderId, conflictResolutionMode, messageDisposition, sendInvitationsOrCancellationsMode.HasValue ? sendInvitationsOrCancellationsMode : this.DefaultSendInvitationsOrCancellationsMode, suppressReadReceipts); } // Regardless of whether item is dirty or not, if it has unprocessed // attachment changes, validate them and process now. if (this.HasUnprocessedAttachmentChanges()) { this.Attachments.Validate(); this.Attachments.Save(); } return returnedItem; }
/// <summary> /// Update item. /// </summary> /// <param name="parentFolderId">The parent folder id.</param> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> /// <param name="messageDisposition">The message disposition.</param> /// <param name="sendInvitationsOrCancellationsMode">The send invitations or cancellations mode.</param> /// <returns>Updated item.</returns> internal Item InternalUpdate( FolderId parentFolderId, ConflictResolutionMode conflictResolutionMode, MessageDisposition? messageDisposition, SendInvitationsOrCancellationsMode? sendInvitationsOrCancellationsMode) { return this.InternalUpdate(parentFolderId, conflictResolutionMode, messageDisposition, sendInvitationsOrCancellationsMode, false); }
public SqlContainerImpl WithConflictResolutionPath(ConflictResolutionMode mode, string conflictResolutionPath) { return(this.WithConflictResolutionPolicy(new Models.ConflictResolutionPolicy(mode: mode, conflictResolutionPath: conflictResolutionPath))); }
/// <summary> /// Applies the local changes that have been made to this task. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param> /// <returns> /// A Task object representing the completed occurrence if the task is recurring and the update marks it as completed; or /// a Task object representing the current occurrence if the task is recurring and the uypdate changed its recurrence /// pattern; or null in every other case. /// </returns> public new Task Update(ConflictResolutionMode conflictResolutionMode) { return (Task)this.InternalUpdate( null /* parentFolder */, conflictResolutionMode, MessageDisposition.SaveOnly, null); }
/// <summary> /// Update item. /// </summary> /// <param name="parentFolderId">The parent folder id.</param> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> /// <param name="messageDisposition">The message disposition.</param> /// <param name="sendInvitationsOrCancellationsMode">The send invitations or cancellations mode.</param> /// <returns>Updated item.</returns> internal async System.Threading.Tasks.Task<Item> InternalUpdateAsync( FolderId parentFolderId, ConflictResolutionMode conflictResolutionMode, MessageDisposition? messageDisposition, SendInvitationsOrCancellationsMode? sendInvitationsOrCancellationsMode) { return await this.InternalUpdateAsync(parentFolderId, conflictResolutionMode, messageDisposition, sendInvitationsOrCancellationsMode, false); }
/// <summary> /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> /// <param name="suppressReadReceipts">Whether to suppress read receipts</param> public async System.Threading.Tasks.Task UpdateAsync(ConflictResolutionMode conflictResolutionMode, bool suppressReadReceipts) { await this.InternalUpdateAsync( null /* parentFolder */, conflictResolutionMode, MessageDisposition.SaveOnly, null, suppressReadReceipts); }
/// <summary> /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS. /// Mutliple calls to EWS might be made if attachments have been added or removed. /// </summary> /// <param name="conflictResolutionMode">The conflict resolution mode.</param> public Task <Item> Update(ConflictResolutionMode conflictResolutionMode, CancellationToken token = default(CancellationToken)) { return(this.Update(conflictResolutionMode, false, token)); }