我正在尝试从AWS s3获取类似于此处提到的对象内容
https://forums.aws.amazon.com/message.jspa?messageID=471149
即使在尝试解决上述问题之后,我仍然会遇到异常。
下面的是scala代码
val s3Object = amazonS3Client.getObject(new GetObjectRequest(bucketName, key))
try {
val objectContent = s3Object.getObjectContent
Some(new GZIPInputStream(new BufferedInputStream(objectContent)))
} catch {
case e : Exception => {
val logMessage = "ContentFetchingException, key=" + key
logError(logMessage, e)
None
}
} finally {
if (s3Object != null) {
s3Object.close()
}
}