Skip to content

Commit

Permalink
feat(file-storage/minio): add deleteFileUnsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
alesharik committed Jun 23, 2024
1 parent deed2fc commit 0a3f84b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libs/file-storage/minio/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "1.1.4"
version = "1.1.5"

dependencies {
api(project(":file-storage-api"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ public void deleteFile(@NonNull String type, @NonNull String itemId, @NonNull St
client.deleteObject(properties.getBucket(), object);
}

public void deleteFileUnsafe(@NonNull String type, @NonNull String itemId, @NonNull String id) {
var object = parseObjectUnsafe(type, itemId, id);
client.deleteObject(properties.getBucket(), object);
}

@Override
@NonNull
public String getLink(@NonNull String type, @NonNull String itemId, @NonNull String filename) {
Expand All @@ -123,6 +128,11 @@ private String parseObject(@NonNull String type, @NonNull String itemId, @NonNul
return type + "/" + itemId + "/" + id;
}


private String parseObjectUnsafe(@NonNull String type, @NonNull String itemId, @NonNull String id) {
return type + "/" + itemId + "/" + id;
}

private static String getFilename(String path) {
int sep = path.lastIndexOf(UNIX_SEPARATOR);
if (sep == -1)
Expand Down

0 comments on commit 0a3f84b

Please sign in to comment.