Skip to content

Commit

Permalink
Foxes #32 hubiC: Save with a full path name in a non-existent folder …
Browse files Browse the repository at this point in the history
…works but could not be reopened
  • Loading branch information
Kyrodan committed Jun 22, 2016
1 parent 9a57e5e commit 0019607
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions KeeAnywhere/StorageProviders/HubiC/HubiCStorageProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public async Task<bool> Save(Stream stream, string path)

var client = await GetClient();
var normalizedPath = path.StartsWith("/") ? path.Remove(0, 1) : path;
var folderName = CloudPath.GetDirectoryName(normalizedPath);

var folder = await client.GetObjects(container, folderName);
if (folder == null || !folder.Any())
throw new InvalidOperationException(string.Format("Folder does not exist: {0}", folderName));

var isOk = await client.UploadObject(container, normalizedPath, stream);

Expand Down

0 comments on commit 0019607

Please sign in to comment.