执行以下代码段时得到了java.lang.NoSuchFieldError:ALLOW_FINAL_FIELDS_AS_MUTATORS。
S3Object object = s3Client.getObject(new GetObjectRequest(bucketName, fileName));
InputStream reader = new BufferedInputStream(object.getObjectContent());
File file = new File(filePathToDownload);
OutputStream writer = new BufferedOutputStream(new FileOutputStream(file));
int read = -1;
while ( ( read = reader.read() ) != -1 ) {
writer.write(read);
}
writer.flush();
writer.close();
reader.close();
答案 0 :(得分:0)
最后,我通过在AmazonS3初始化中提供适当的凭据和客户端配置解决了我的错误。谢谢你们的支持。