Skip to content

Commit

Permalink
Bugfix putobject (#20)
Browse files Browse the repository at this point in the history
* adding a console line to understand where files are being put, and attempted to fix a potential path problem.

* bump package version for bugfix

* converting string to char

* removing duplicated call to getobjectkey
  • Loading branch information
HenryGeorgist authored Aug 23, 2023
1 parent 4e57f3f commit c6bd13b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Usace.CC.Plugin/FileDataStoreS3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public class FileDataStoreS3 : IFileDataStore

private string GetObjectKey(string path)
{
path = path.TrimStart('/');//paths combine adds path separator if it is not present at the *end* of an argument. Does not check the beginning of an argument.
var key = Path.Combine(prefix,path);
key = key.TrimStart('/');
return key;
}

Expand Down Expand Up @@ -64,7 +66,9 @@ public async Task<bool> PutAsync(Stream data, string path)
}
public async Task<bool> Put(Stream data, string path)
{
return await bucket.CreateObject(GetObjectKey(path), data);
var key = GetObjectKey(path);
Console.WriteLine("Putting object at key: " + key);
return await bucket.CreateObject(key, data);
}

public async Task<Stream> Get(string path)
Expand Down
2 changes: 1 addition & 1 deletion Usace.CC.Plugin/Usace.CC.Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageDescription>
Usace.CC.Plugin can be used to build plugins for Cloud Compute
</PackageDescription>
<PackageVersion>1.0.3</PackageVersion>
<PackageVersion>1.0.4</PackageVersion>

</PropertyGroup>

Expand Down

0 comments on commit c6bd13b

Please sign in to comment.