diff --git a/buildSrc/src/main/kotlin/org/noelware/remi/gradle/Metadata.kt b/buildSrc/src/main/kotlin/org/noelware/remi/gradle/Metadata.kt index aef96b60..174e4ef0 100644 --- a/buildSrc/src/main/kotlin/org/noelware/remi/gradle/Metadata.kt +++ b/buildSrc/src/main/kotlin/org/noelware/remi/gradle/Metadata.kt @@ -26,5 +26,5 @@ package org.noelware.remi.gradle import org.gradle.api.JavaVersion import dev.floofy.utils.gradle.* -val VERSION = Version(0, 5, 2, 0, ReleaseType.Beta) +val VERSION = Version(0, 5, 3, 0, ReleaseType.Beta) val JAVA_VERSION = JavaVersion.VERSION_17 diff --git a/core/src/main/java/org/noelware/remi/core/Blob.java b/core/src/main/java/org/noelware/remi/core/Blob.java index 2d1bcb80..1e2701b1 100644 --- a/core/src/main/java/org/noelware/remi/core/Blob.java +++ b/core/src/main/java/org/noelware/remi/core/Blob.java @@ -58,14 +58,14 @@ public class Blob { * @param size The size of this blob. */ public Blob( - Instant lastModifiedAt, - Instant createdAt, - String contentType, - InputStream stream, - String etag, - String name, - String providerName, - String path, + @Nullable Instant lastModifiedAt, + @Nullable Instant createdAt, + @Nullable String contentType, + @Nullable InputStream stream, + @Nullable String etag, + @NotNull String name, + @NotNull String providerName, + @NotNull String path, long size) { this.lastModifiedAt = lastModifiedAt; this.contentType = contentType; @@ -131,6 +131,7 @@ public String path() { /** * @return etag for this blob */ + @Nullable public String etag() { return etag; } diff --git a/support/fs/src/main/java/org/noelware/remi/support/filesystem/FilesystemStorageService.java b/support/fs/src/main/java/org/noelware/remi/support/filesystem/FilesystemStorageService.java index 7f2473c2..b4d30c7b 100644 --- a/support/fs/src/main/java/org/noelware/remi/support/filesystem/FilesystemStorageService.java +++ b/support/fs/src/main/java/org/noelware/remi/support/filesystem/FilesystemStorageService.java @@ -135,15 +135,12 @@ public Blob blob(String path) throws IOException { // Get the content type of the buffer final String contentType = getContentTypeOf(data); - // Create the Etag for this file - final String etag = - "\"%s-%s\"".formatted(Long.toString(data.length, 16), sha1(data).substring(0, 27)); return new Blob( attributes.lastModifiedTime().toInstant(), attributes.creationTime().toInstant(), contentType, new ByteArrayInputStream(data), - etag, + null, file.getName(), "fs", String.format("fs://%s", file), @@ -187,18 +184,12 @@ public List blobs(@Nullable ListBlobsRequest request) throws IOException { throw new RuntimeException(e); } - // Create the Etag for this file - final String etag = "\"%s-%s\"" - .formatted( - Long.toString(data.length, 16), - sha1(data).substring(0, 27)); - return new Blob( attributes.lastModifiedTime().toInstant(), attributes.creationTime().toInstant(), contentType, new ByteArrayInputStream(data), - etag, + null, file.toFile().getName(), "fs", String.format("fs://%s", file),