Skip to content

Commit

Permalink
implement S34K v0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxcapades committed Jun 14, 2023
1 parent ab80bfa commit 93d8973
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 9 deletions.
11 changes: 5 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm") version "1.8.0"
id("org.jetbrains.dokka") version "1.7.20"
kotlin("jvm") version "1.8.22"
id("org.jetbrains.dokka") version "1.8.20"
`java-library`
`maven-publish`
}

group = "org.veupathdb.lib.s3"
version = "0.5.0+s34k-0.9.0"
version = "0.6.0+s34k-0.10.0"

java {
sourceCompatibility = JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -36,10 +36,9 @@ dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("stdlib-jdk8"))
implementation("org.slf4j:slf4j-api:1.7.36")
implementation("io.minio:minio:8.4.5")
implementation("io.minio:minio:8.5.3")

@Suppress("GradlePackageVersionRange")
api("org.veupathdb.lib.s3:s34k-core:0.8.0+s34k-0.9.0")
api("org.veupathdb.lib.s3:s34k-core:0.9.0+s34k-0.10.0")

testImplementation(kotlin("test"))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ internal class BucketObjectContainer(
res.`object`(),
res.lastModified(),
res.eTag(),
res.size(),
res.region(),
MHeaders(res.headers()),
bucket,
Expand Down Expand Up @@ -240,6 +241,7 @@ internal class BucketObjectContainer(
res.`object`(),
res.lastModified().toOffsetDateTime(),
res.etag(),
res.size(),
res.region(),
MHeaders(res.headers()),
bucket,
Expand Down Expand Up @@ -267,6 +269,7 @@ internal class BucketObjectContainer(
it.objectName(),
it.lastModified().toOffsetDateTime(),
it.etag(),
it.size(),
bucket.region,
MHeaders(),
bucket,
Expand Down Expand Up @@ -301,6 +304,7 @@ internal class BucketObjectContainer(
it.objectName(),
it.lastModified().toOffsetDateTime(),
it.etag(),
it.size(),
bucket.region,
MHeaders(),
bucket,
Expand Down Expand Up @@ -333,6 +337,7 @@ internal class BucketObjectContainer(
it.objectName(),
it.lastModified().toOffsetDateTime(),
it.etag(),
it.size(),
bucket.region,
MHeaders(),
bucket,
Expand Down Expand Up @@ -370,6 +375,7 @@ internal class BucketObjectContainer(
res.`object`(),
res.lastModified(),
res.eTag(),
res.size(),
res.region(),
res,
MHeaders(res.headers()),
Expand Down Expand Up @@ -401,6 +407,7 @@ internal class BucketObjectContainer(
path,
OffsetDateTime.now(),
res.etag(),
0L,
res.region(),
MHeaders(res.headers()),
bucket,
Expand Down Expand Up @@ -441,6 +448,7 @@ internal class BucketObjectContainer(
it.objectName(),
it.lastModified().toOffsetDateTime(),
it.etag(),
it.size(),
bucket.region,
MHeaders(),
bucket,
Expand All @@ -464,6 +472,7 @@ internal class BucketObjectContainer(
it.objectName(),
it.lastModified().toOffsetDateTime(),
it.etag(),
it.size(),
bucket.region,
MHeaders(),
bucket,
Expand Down Expand Up @@ -495,6 +504,7 @@ internal class BucketObjectContainer(
res.`object`(),
null,
res.etag(),
0L,
res.region(),
MHeaders(res.headers()),
bucket,
Expand All @@ -521,6 +531,7 @@ internal class BucketObjectContainer(
path,
stat.lastModified().toOffsetDateTime(),
stat.etag(),
stat.size(),
bucket.region,
MHeaders(stat.headers()),
bucket,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ internal class MFileObject(
path: String,
lastModified: OffsetDateTime?,
eTag: String,
size: Long,
region: String?,
headers: Headers,
bucket: S3Bucket,
client: MinioClient,
override val localFile: File,
) : FileObject, MObject(path, lastModified, eTag, region, headers, bucket, client)
) : FileObject, MObject(path, lastModified, eTag, size, region, headers, bucket, client)
3 changes: 2 additions & 1 deletion src/main/kotlin/org/veupathdb/lib/s3/s34k/minio/MObject.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@ internal open class MObject(
path: String,
lastModified: OffsetDateTime?,
eTag: String,
size: Long,
region: String?,
headers: Headers,
bucket: S3Bucket,

private val client: MinioClient,
) : AbstractS3Object(path, lastModified, eTag, region, headers, bucket) {
) : AbstractS3Object(path, lastModified, eTag, size, region, headers, bucket) {

private val log = LoggerFactory.getLogger(this::class.java)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ internal class MStreamObject(
path: String,
lastModified: OffsetDateTime?,
eTag: String,
size: Long,
region: String?,
override val stream: InputStream,
headers: Headers,
bucket: S3Bucket,
client: MinioClient
) : StreamObject, MObject(path, lastModified, eTag, region ,headers, bucket, client) {
) : StreamObject, MObject(path, lastModified, eTag, size, region ,headers, bucket, client) {
override fun close() = stream.close()
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ internal class ObjectToucher(
res.`object`(),
res.lastModified().toOffsetDateTime(),
res.etag(),
res.size(),
res.region(),
MHeaders(res.headers()),
bucket,
Expand Down Expand Up @@ -79,6 +80,7 @@ internal class ObjectToucher(
res.`object`(),
null,
res.etag(),
0L,
res.region(),
MHeaders(res.headers()),
bucket,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ import io.minio.GetObjectResponse
import java.time.OffsetDateTime
import java.time.format.DateTimeFormatter

internal inline fun GetObjectResponse.size() =
headers()["Content-Length"]!!.toLong()

internal inline fun GetObjectResponse.lastModified() =
OffsetDateTime.parse(headers()["Last-Modified"], DateTimeFormatter.RFC_1123_DATE_TIME)

Expand Down

0 comments on commit 93d8973

Please sign in to comment.