Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetObject API with Args & Response objects. #473

Merged
merged 9 commits into from
Dec 21, 2020

Conversation

BigUstad
Copy link
Contributor

Versioning related code included. Examples added for versioning & conditional matches.

Versioning related code included. Examples added for versioning & conditional matches.
.WithMatchETag(matchEtag)
.WithNotMatchETag(notMatchEtag)
.WithModifiedSince(modifiedSince)
.WithUnModifiedSince(unModifiedSince);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove conflicting options from the example

}
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this example pertains to PR #472 . Can it be removed?

private const string getObjectSignature3 = "Task GetObjectAsync(string bucketName, string objectName, string fileName, CancellationToken cancellationToken = default(CancellationToken))";
private const string getObjectSignature1 = "Task GetObjectAsync(GetObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))";
private const string getObjectSignature2 = "Task GetObjectAsync(GetObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))";
private const string getObjectSignature3 = "Task GetObjectAsync(GetObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they now have same signature - please remove the duplicates

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not pushed the resolved conflicts files yet. I will do it soon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

public string GetCustomerKeyMD5()
{
return utils.getMD5SumStr(this.key);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we decide in previous reviews that this method is unnecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not pushed the resolved conflicts files yet. I will do it soon.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

@poornas
Copy link
Contributor

poornas commented Nov 23, 2020

can you rebase this PR @BigUstad

@BigUstad
Copy link
Contributor Author

can you rebase this PR @BigUstad

Yes @poornas I'm rebasing all PRs that needs merging.

@BigUstad BigUstad force-pushed the 1-minio-dotnet-getobject branch 5 times, most recently from 8a05618 to f20205f Compare November 24, 2020 20:30
Copy link
Contributor

@poornas poornas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github actions reported warnings/errors need to be fixed.

Minio/DataModel/ObjectOperationsArgs.cs Outdated Show resolved Hide resolved
public string GetCustomerKeyMD5()
{
return utils.getMD5SumStr(this.key);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

Minio/DataModel/ServerSideEncryption.cs Outdated Show resolved Hide resolved
public string GetCustomerKeyMD5()
{
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this method is not required.

Minio/Helper/OperationsHelper.cs Show resolved Hide resolved
Minio/Helper/OperationsHelper.cs Show resolved Hide resolved
private const string getObjectSignature3 = "Task GetObjectAsync(string bucketName, string objectName, string fileName, CancellationToken cancellationToken = default(CancellationToken))";
private const string getObjectSignature1 = "Task GetObjectAsync(GetObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))";
private const string getObjectSignature2 = "Task GetObjectAsync(GetObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))";
private const string getObjectSignature3 = "Task GetObjectAsync(GetObjectArgs args, CancellationToken cancellationToken = default(CancellationToken))";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not fixed

Copy link
Contributor

@poornas poornas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


utils.ValidateFile(tempFileName);

FileInfo tempFileInfo = new FileInfo(tempFileName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be moved inside the if condition code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Changed.

@@ -363,7 +365,7 @@ public PresignedPutObjectArgs WithExpiry(int ex)
}
}

public class RemoveUploadArgs : EncryptionArgs<RemoveUploadArgs>
public class RemoveUploadArgs : EncryptionArgs<RemoveUploadArgs>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, changed.

@BigUstad BigUstad force-pushed the 1-minio-dotnet-getobject branch 2 times, most recently from 1d9afa2 to d6054ac Compare December 7, 2020 21:12

if (this.ObjectLength < 0)
{
throw new ArgumentException("Length should be greater than zero", nameof(this.ObjectLength));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

message should be greater than or equal to

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the message & the condition.

@@ -335,7 +337,7 @@ public PresignedPostPolicyArgs WithPolicy(PostPolicy policy)
{
this.Policy = policy;
return this;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is there an extra space

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happened during vscode 'Accept Both changes'. Removing.

{
FileInfo tempFileInfo = new FileInfo(tempFileName);
tempFileSize = tempFileInfo.Length;
if (tempFileSize > length)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if tempFileSize is < length?

@BigUstad BigUstad force-pushed the 1-minio-dotnet-getobject branch 3 times, most recently from 2e7c0b4 to 5225f13 Compare December 8, 2020 17:35
}
if (File.Exists(args.FileName))
{
File.Delete(tempFileName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
File.Delete(tempFileName);
File.Delete(args.FileName);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing that.

Copy link
Contributor

@kannappanr kannappanr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kannappanr kannappanr merged commit b61b0c7 into minio:master Dec 21, 2020
@BigUstad BigUstad deleted the 1-minio-dotnet-getobject branch December 21, 2020 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants