5 java sdk 调用问题

版本说明 sdk 8.2.1

// Lists objects information.
Iterable<Result<Item>> results =
minioClient.listObjects(ListObjectsArgs.builder().bucket("original-file").prefix("image").startAfter("00d64f0335e09ccc90595f951240dae6.jpg").recursive(true).maxKeys(5).build());

for (Result<Item> result : results) {
Item item = result.get();
System.out.println(item.lastModified() + "\t" + item.size() + "\t" + item.objectName());
}

java 官方的demo中,发现了两个问题:

1:当使用startAfter参数的时候,服务器端会返回

    A header you provided implies functionality that is not implemented 错误

详情如下:

Error occurred: error occurred
ErrorResponse(code = NotImplemented, message = A header you provided implies functionality that is not implemented, bucketName = original-file, objectName = null, resource = /original-file, requestId = 16AB07DF53E67A98, hostId = 5889388e-f729-4b3c-9caa-b7ba9a1d1e52)
request={method=GET, url=http://172.18.206.123:9000/original-file?list-type=2&prefix=image&start-after=00d64f0335e09ccc90595f951240dae6.jpg&max-keys=5&encoding-type=url&delimiter=, headers=Host: 172.18.206.123:9000
Accept-Encoding: identity
User-Agent: MinIO (Windows 10; amd64) minio-java/8.2.1
Content-MD5: 1B2M2Y8AsgTpgAmY7PhCfg==
x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
x-amz-date: 20211005T042605Z
Authorization: AWS4-HMAC-SHA256 Credential=*REDACTED*/20211005/us-east-1/s3/aws4_request, SignedHeaders=content-md5;host;x-amz-content-sha256;x-amz-date, Signature=*REDACTED*
}
response={code=501, headers=Accept-Ranges: bytes
Content-Length: 332
Content-Security-Policy: block-all-mixed-content
Content-Type: application/xml
Server: MinIO
Vary: Origin
X-Amz-Request-Id: 16AB07DF53E67A98
X-Xss-Protection: 1; mode=block
Date: Tue, 05 Oct 2021 04:25:45 GMT
}


2:maxKeys 参数不起作用。

请先 登录 后评论

1 个回答

MinIO

哪个版本的sdk呀,感觉像是使用到了未实现的功能。

请先 登录 后评论
  • 1 关注
  • 0 收藏,134 浏览
  • 迷途书童 提出于 2021-10-05 12:26

相似问题