Skip to content

Commit

Permalink
Updated dependencies (#20)
Browse files Browse the repository at this point in the history
* Updated dependencies

* fixed tests
  • Loading branch information
oyakovlev authored Jan 31, 2023
1 parent 1d6cb61 commit dc5a432
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ repositories {
}

// Append dependency
implementation("com.icerockdev:storage-service:0.6.0")
implementation("com.icerockdev:storage-service:0.7.0")
````

## Library usage
Expand Down
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ org.gradle.parallel=true
org.gradle.caching=true

kotlin.code.style=official
kotlin_version=1.6.10
ktor_version=1.6.7
java_dotenv_version=5.2.1
logback_version=1.2.3
aws_sdk_s3_version=2.14.2
scrimage_version=4.0.6
coroutines_version=1.6.0
jackson_version=2.12.3
apache_tika_version=2.0.0
kotlin_version=1.7.21
ktor_version=2.2.2
java_dotenv_version=5.2.2
logback_version=1.4.5
aws_sdk_s3_version=2.19.26
scrimage_version=4.0.33
coroutines_version=1.6.4
jackson_version=2.14.1
apache_tika_version=2.6.0
3 changes: 1 addition & 2 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ application {
}

dependencies {
// Kotlin
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${properties["kotlin_version"]}")
// Ktor
implementation("io.ktor:ktor-server-core:${properties["ktor_version"]}")
implementation("io.ktor:ktor-server-netty:${properties["ktor_version"]}")
implementation("io.ktor:ktor-server-call-logging:${properties["ktor_version"]}")
// Dotenv
implementation("io.github.cdimascio:java-dotenv:${properties["java_dotenv_version"]}")
// Logging
Expand Down
16 changes: 8 additions & 8 deletions sample/src/main/kotlin/com/icerockdev/sample/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ package com.icerockdev.sample
import com.icerockdev.service.storage.s3.S3StorageImpl
import com.icerockdev.service.storage.s3.minioConfBuilder
import io.github.cdimascio.dotenv.dotenv
import io.ktor.application.ApplicationCall
import io.ktor.application.call
import io.ktor.application.install
import io.ktor.features.CallLogging
import io.ktor.http.ContentType
import io.ktor.http.content.PartData
import io.ktor.http.content.forEachPart
import io.ktor.http.content.streamProvider
import io.ktor.request.receiveMultipart
import io.ktor.response.respondText
import io.ktor.routing.post
import io.ktor.routing.routing
import io.ktor.server.application.ApplicationCall
import io.ktor.server.application.call
import io.ktor.server.application.install
import io.ktor.server.engine.embeddedServer
import io.ktor.server.netty.Netty
import io.ktor.server.plugins.callloging.CallLogging
import io.ktor.server.request.receiveMultipart
import io.ktor.server.response.respondText
import io.ktor.server.routing.post
import io.ktor.server.routing.routing
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider
import software.amazon.awssdk.regions.Region
Expand Down
4 changes: 1 addition & 3 deletions storage-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@ apply(plugin = "java")
apply(plugin = "kotlin")

group = "com.icerockdev"
version = "0.6.0"
version = "0.7.0"

val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}

dependencies {
// Kotlin
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:${properties["kotlin_version"]}")
// AWS S3 SDK
api("software.amazon.awssdk:s3:${properties["aws_sdk_s3_version"]}")
// Apache Tika
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ import java.io.BufferedInputStream
import java.io.InputStream
import java.net.MalformedURLException
import java.net.URI
import java.net.URLEncoder
import java.nio.charset.StandardCharsets
import java.time.Duration

/**
Expand Down Expand Up @@ -211,9 +209,9 @@ class S3StorageImpl(private val client: S3Client, private val preSigner: S3Presi
override fun copy(srcBucket: String, srcKey: String, dstBucket: String, dstKey: String): Boolean {

return try {
val encodedUrl = URLEncoder.encode("$srcBucket/$srcKey", StandardCharsets.UTF_8.toString())
val request = CopyObjectRequest.builder()
.copySource(encodedUrl)
.sourceBucket(srcBucket)
.sourceKey(srcKey)
.destinationBucket(dstBucket)
.destinationKey(dstKey)
.build()
Expand Down
2 changes: 1 addition & 1 deletion storage-service/src/test/kotlin/S3StorageTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class S3StorageTest {
}

assertFalse {
storage.deleteBucket("another bucket")
storage.deleteBucket("another-bucket")
}

// check correct delete
Expand Down

0 comments on commit dc5a432

Please sign in to comment.