我有一个数据库实体,它与存储在MinIO中的许多文件相连接。如何在一次操作中删除多个文件?
qni6mghb1#
如果你正在使用minioClient,你可以尝试这样做:
List<DeleteObject> objects = new LinkedList<>(); objects.add(new DeleteObject("my-objectname1")); objects.add(new DeleteObject("my-objectname2")); objects.add(new DeleteObject("my-objectname3")); Iterable<Result<DeleteError>> results = minioClient.removeObjects( RemoveObjectsArgs.builder().bucket("my-bucketname").objects(objects).build()); for (Result<DeleteError> result : results) { DeleteError error = errorResult.get(); System.out.println( "Error in deleting object " + error.objectName() + "; " + error.message()); }
1条答案
按热度按时间qni6mghb1#
如果你正在使用minioClient,你可以尝试这样做: