-
Notifications
You must be signed in to change notification settings - Fork 485
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
Download the contents from a encrypted object to a given file. #736
Conversation
4e6b4b9
to
b6a46f1
Compare
* @param bucketName Bucket name. | ||
* @param objectName Object name in the bucket. | ||
* @param sse encryption metadata. | ||
* @param fileName file named. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
named
=> name
or maybe even file name to download into
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|| (sse.getType() == ServerSideEncryption.Type.SSE_KMS)) { | ||
throw new InvalidArgumentException("Invalid encryption option specified for encryption type " + sse.getType()); | ||
} else if ((sse.getType() == ServerSideEncryption.Type.SSE_C) && (!this.baseUrl.isHttps())) { | ||
throw new InvalidArgumentException("SSE_C provided keys must be made over a secure connection."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SSE_C
=> SSE-C
In Amazon terminology, SSE-C is "Server-Side Encryption with Customer provided encryption keys".
So, "SSE-C
provided
keys ..."
doesn't make sense.
Probably, "SSE_C provided keys ..."
can be replaced with "SSE-C keys ...
or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified.
// already downloaded. nothing to do | ||
return; | ||
} else if (fileSize > length) { | ||
throw new InvalidArgumentException("'" + fileName + "': object size " + length + " is smaller than file size " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"'" + fileName + "': object size " + length + " is smaller than file size " + fileSize
IMHO, this message is confusing. At least it confused me. I thought fileName
has the object size length
.
Would it be clearer if it is changed something like:
"Source object, '" + objectName + "', size:" + length + " is smaller than the destination file, '" + fileName + "', size:" + fileSize
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed.
docs/API.md
Outdated
|
||
`public void getObject(String bucketName, String objectName, ServerSideEncryption sse, String fileName)` | ||
|
||
Download the contents from a encrypted objectName to a given file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
a encrypted
=> an encrypted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
altered
docs/API.md
Outdated
| ``bucketName`` | _String_ | Name of the bucket. | | ||
| ``objectName`` | _String_ | Object name in the bucket. | | ||
| ``sse`` | _ServerSideEncryption_ | Form of server-side encryption [ServerSideEncryption](http://minio.github.io/minio-java/io/minio/ServerSideEncryption.html). | | ||
| ``fileName`` | _String_ | File name. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe File name to download into
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
docs/API.md
Outdated
| | ``org.xmlpull.v1.XmlPullParserException`` : upon parsing response XML. | | ||
| | ``ErrorResponseException`` : upon unsuccessful execution. | | ||
| | ``InternalException`` : upon internal library error. | | ||
| | ``InvalidArgumentException`` : upon invalid value is passed to a method. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe:
upon invalid value is passed to a method.
=> upon passing of an invalid to a method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
b6a46f1
to
42e08f6
Compare
New method introduced to get the Encrypted Object and write to a file . getObject(String bucketName, String objectName, ServerSideEncryption sse, String fileName)
42e08f6
to
55396f0
Compare
There was a Travis failure about socket timeout during a functional test. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
New method introduced to get the Encrypted Object and write to
a file .
getObject(String bucketName, String objectName, ServerSideEncryption sse, String fileName)