Ejemplo n.º 1
0
        public async Task CommitBlobAsync(long tenantId, long blobId, string path)
        {
            // Get blob info
            Blob blob = await _storageRepository.ReadBlobAsync(tenantId, blobId);

            // Set committed flag to true
            blob.Updated = DateTime.UtcNow;
            await _storageRepository.CommitBlobAsync(tenantId, blobId, blob.Updated);

            // Create copy of upload at new path location
            blob.Path = UncommittedPath;
            Stream stream = await _blobService.ReadBlobContentAsync(blob);

            blob.Path = path;
            await _blobService.CreateBlobContentAsync(blob, stream);

            // Delete uncommitted upload from storage
            blob.Path = UncommittedPath;
            await _blobService.DeleteBlobContentAsync(blob);
        }
Ejemplo n.º 2
0
        public async Task DeleteBlobAsync(long tenantId, long blobId)
        {
            Blob blob = await _storageRepository.ReadBlobAsync(tenantId, blobId);

            if (blob == null)
            {
                return;
            }
            await _blobService.DeleteBlobContentAsync(blob);

            await _storageRepository.DeleteBlobAsync(tenantId, blobId);
        }