Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codehive-backend/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dependencies {
testRuntimeOnly("com.h2database:h2")

// Minio
implementation("io.minio:minio:8.6.0")
implementation("io.minio:minio:9.0.4")

// RabbitMQ
implementation("org.springframework.boot:spring-boot-starter-amqp")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import io.minio.MinioClient;
import io.minio.ListObjectsArgs;
import io.minio.RemoveObjectsArgs;
import io.minio.messages.DeleteObject;
import io.minio.messages.DeleteRequest;
import io.minio.PutObjectArgs;

@Service
Expand All @@ -31,7 +31,7 @@ public void upload(String objectKey, InputStream data, long size, String content
io.minio.PutObjectArgs.builder()
.bucket(bucketName)
.object(objectKey)
.stream(data, size, -1)
.stream(data, size, -1L)
.contentType(contentType)
.build()
);
Expand All @@ -45,7 +45,7 @@ public void upload(String objectKey, String content) throws Exception {
PutObjectArgs.builder()
.bucket(bucketName)
.object(objectKey)
.stream(stream, contentBytes.length, -1)
.stream(stream, (long) contentBytes.length, -1L)
.contentType("text/plain")
.build()
);
Expand All @@ -62,10 +62,10 @@ public InputStream download(String objectKey) throws Exception {
}

public void deletePrefix(String prefix) throws Exception {
List<DeleteObject> objects = new ArrayList<>();
List<DeleteRequest.Object> objects = new ArrayList<>();
for (var result : minioClient.listObjects(ListObjectsArgs.builder()
.bucket(bucketName).prefix(prefix).recursive(true).build())) {
objects.add(new DeleteObject(result.get().objectName()));
objects.add(new DeleteRequest.Object(result.get().objectName()));
}
if (objects.isEmpty()) return;

Expand Down
Loading