我正在尝试下载" csv.gz"使用aws java SDK从S3存储桶中获取文件。
AWSCredentials credentails = new BasicAWSCredentials(accessKey, secretKey);
AmazonS3 s3Connection = new AmazonS3Client(credentails);
S3Object s3object = connection.getObject(new GetObjectRequest(
bucketName, filename));
使用S3Connection.getObject()方法时,我收到以下日期格式错误。
com.amazonaws.services.s3.internal.S3MetadataResponseHandler populateObjectMetadata
WARNING: Unable to parse http expiration date: Wed, 31 Dec 1969 16:00:00 PST
java.lang.IllegalArgumentException: Invalid format: "Wed, 31 Dec 1969 16:00:00 PST" is malformed at " PST"
at org.joda.time.format.DateTimeParserBucket.doParseMillis(DateTimeParserBucket.java:187)
at org.joda.time.format.DateTimeFormatter.parseMillis(DateTimeFormatter.java:780)
at com.amazonaws.util.DateUtils.parseRFC822Date(DateUtils.java:196)
at com.amazonaws.services.s3.internal.AbstractS3ResponseHandler.populateObjectMetadata(AbstractS3ResponseHandler.java:136)
at com.amazonaws.services.s3.internal.S3ObjectResponseHandler.handle(S3ObjectResponseHandler.java:51)
at com.amazonaws.services.s3.internal.S3ObjectResponseHandler.handle(S3ObjectResponseHandler.java:30)
at com.amazonaws.http.AmazonHttpClient.handleResponse(AmazonHttpClient.java:1179)
at com.amazonaws.http.AmazonHttpClient.executeOneRequest(AmazonHttpClient.java:820)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:630)
at com.amazonaws.http.AmazonHttpClient.doExecute(AmazonHttpClient.java:405)
at com.amazonaws.http.AmazonHttpClient.executeWithTimer(AmazonHttpClient.java:367)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:318)
at com.amazonaws.services.s3.AmazonS3Client.invoke(AmazonS3Client.java:3787)
at com.amazonaws.services.s3.AmazonS3Client.getObject(AmazonS3Client.java:1137)
有人可以帮我解决这个问题。
提前致谢,
塞特希