예제 #1
0
        public void RestoreSnapshot(PackageHandler item, SnapshotHandler snapshot)
        {
            var blob         = ((AzurePackageHandler)item).Blob;
            var snapshotBlob = ((AzureSnapshotHandler)snapshot).Blob;

            blob.StartCopy(snapshotBlob);
        }
        public void RestoreSnapshot(PackageHandler item, SnapshotHandler snapshot)
        {
            var src          = (FileSystemStorage.FileSystemHandler)item;
            var snapshotItem = (FileSystemSnapshotHandler)snapshot;

            File.Copy(snapshotItem.FilePath, src.FilePath, true);
        }
예제 #3
0
        public async Task <SnapshotHandler> CreateSnapshot(PackageHandler item)
        {
            var blob           = ((AzurePackageHandler)item).Blob;
            var sourceSnapshot = await blob.CreateSnapshotAsync();

            return(new AzureSnapshotHandler(sourceSnapshot));
        }
예제 #4
0
        public Task UploadAsync(PackageHandler item, string path)
        {
            var h = (FileSystemHandler)item;

            File.Copy(path, h.FilePath, true);
            return(Task.FromResult(0));
        }
        public async Task <SnapshotHandler> CreateSnapshot(PackageHandler item)
        {
            var src  = (FileSystemStorage.FileSystemHandler)item;
            var dest = Path.Combine(_tempDirectory, src.Name);

            return(await Task.Run(() =>
            {
                File.Copy(src.FilePath, dest, true);
                return new FileSystemSnapshotHandler(dest);
            }));
        }
예제 #6
0
 public async Task UploadAsync(PackageHandler item, string path)
 {
     var sourceBlob = ((AzurePackageHandler)item).Blob;
     await sourceBlob.UploadFromFileAsync(path);
 }
예제 #7
0
 public async Task DownloadAsync(PackageHandler item, string path)
 {
     var sourceBlob = ((AzurePackageHandler)item).Blob;
     await sourceBlob.DownloadToFileAsync(path, FileMode.Create);
 }