From 48cb222630487cf86502716d053c4d88688c503d Mon Sep 17 00:00:00 2001 From: Okan Okumusoglu Date: Wed, 17 Jun 2026 13:54:26 +0300 Subject: [PATCH 1/2] upgrade dependencies --- .editorconfig | 5 ++ build.gradle.kts | 20 +++---- .../RuntimeHintsAutoConfiguration.kt | 2 +- .../valensas/ftp/factory/FtpClientFactory.kt | 13 +++-- .../ftp/hints/CustomRuntimeHintsRegistrar.kt | 6 +-- .../ftp/hints/JschRuntimeHintsRegistrar.kt | 12 ++--- .../com/valensas/ftp/model/ConnectionMode.kt | 2 +- .../com/valensas/ftp/model/ConnectionModel.kt | 2 +- .../valensas/ftp/model/ConnectionResult.kt | 4 +- .../com/valensas/ftp/model/ConnectionType.kt | 2 +- .../valensas/ftp/model/ConnectionVariant.kt | 2 +- .../com/valensas/ftp/model/FTPClient.kt | 2 +- .../com/valensas/ftp/model/FTPSClient.kt | 17 +++--- .../com/valensas/ftp/model/SFTPClient.kt | 34 ++++++------ .../valensas/ftp/server/EmbeddedFtpServer.kt | 4 +- .../valensas/ftp/server/EmbeddedSftpServer.kt | 4 +- src/test/kotlin/com/valensas/ftp/Fake.kt | 3 +- .../com/valensas/ftp/FtpApplicationTests.kt | 52 +++++++++---------- 18 files changed, 93 insertions(+), 93 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..45d4fa6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,5 @@ +[*.{kt,kts}] +ij_kotlin_allow_trailing_comma = false +ij_kotlin_allow_trailing_comma_on_call_site = false +ktlint_code_style = intellij_idea +ktlint_standard_no-unused-imports = enabled \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index ae6ee1f..2ae54df 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,12 +1,13 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { - kotlin("jvm") version "2.1.0" - kotlin("plugin.spring") version "2.1.0" + kotlin("jvm") version "2.4.0" + kotlin("plugin.spring") version "2.4.0" id("jacoco") - id("org.jmailen.kotlinter") version "5.3.0" + id("org.jmailen.kotlinter") version "5.5.0" id("com.adarshr.test-logger") version "4.0.0" - id("com.github.ben-manes.versions") version "0.53.0" + id("com.github.ben-manes.versions") version "0.54.0" id("org.springframework.boot") version "4.0.1" id("io.spring.dependency-management") version "1.1.7" id("maven-publish") @@ -14,7 +15,6 @@ plugins { } group = "com.valensas" -version = "0.2.24" java.sourceCompatibility = JavaVersion.VERSION_21 @@ -37,8 +37,8 @@ dependencies { implementation("com.valensas:graalvm-native-support:1.0.8") // Ftp - implementation("commons-net:commons-net:3.12.0") - implementation("com.github.mwiede:jsch:2.27.7") + implementation("commons-net:commons-net:3.13.0") + implementation("com.github.mwiede:jsch:2.28.3") implementation("org.apache.sshd:sshd-core:2.16.0") implementation("org.apache.sshd:sshd-common:2.16.0") implementation("org.apache.sshd:sshd-sftp:2.16.0") @@ -46,9 +46,9 @@ dependencies { } tasks.withType { - kotlinOptions { - freeCompilerArgs += "-Xjsr305=strict" - jvmTarget = "21" + compilerOptions { + freeCompilerArgs.add("-Xjsr305=strict") + jvmTarget.set(JvmTarget.JVM_21) } } diff --git a/src/main/kotlin/com/valensas/ftp/autoconfigure/RuntimeHintsAutoConfiguration.kt b/src/main/kotlin/com/valensas/ftp/autoconfigure/RuntimeHintsAutoConfiguration.kt index f7f634c..fcd519b 100644 --- a/src/main/kotlin/com/valensas/ftp/autoconfigure/RuntimeHintsAutoConfiguration.kt +++ b/src/main/kotlin/com/valensas/ftp/autoconfigure/RuntimeHintsAutoConfiguration.kt @@ -8,6 +8,6 @@ import org.springframework.context.annotation.ImportRuntimeHints @Configuration @ImportRuntimeHints( CustomRuntimeHintsRegistrar::class, - JschRuntimeHintsRegistrar::class, + JschRuntimeHintsRegistrar::class ) class RuntimeHintsAutoConfiguration diff --git a/src/main/kotlin/com/valensas/ftp/factory/FtpClientFactory.kt b/src/main/kotlin/com/valensas/ftp/factory/FtpClientFactory.kt index 7c5f551..7560da5 100644 --- a/src/main/kotlin/com/valensas/ftp/factory/FtpClientFactory.kt +++ b/src/main/kotlin/com/valensas/ftp/factory/FtpClientFactory.kt @@ -9,11 +9,10 @@ import com.valensas.ftp.model.SFTPClient class FtpClientFactory { fun createFtpClient( type: ConnectionType, - variant: ConnectionVariant? = null, - ): FTPClient = - when (type) { - ConnectionType.FTP -> FTPClient() - ConnectionType.FTPS -> FTPSClient(variant == ConnectionVariant.Implicit) - ConnectionType.SFTP -> SFTPClient() - } + variant: ConnectionVariant? = null + ): FTPClient = when (type) { + ConnectionType.FTP -> FTPClient() + ConnectionType.FTPS -> FTPSClient(variant == ConnectionVariant.Implicit) + ConnectionType.SFTP -> SFTPClient() + } } diff --git a/src/main/kotlin/com/valensas/ftp/hints/CustomRuntimeHintsRegistrar.kt b/src/main/kotlin/com/valensas/ftp/hints/CustomRuntimeHintsRegistrar.kt index 91d57ea..1e56723 100644 --- a/src/main/kotlin/com/valensas/ftp/hints/CustomRuntimeHintsRegistrar.kt +++ b/src/main/kotlin/com/valensas/ftp/hints/CustomRuntimeHintsRegistrar.kt @@ -12,13 +12,13 @@ class CustomRuntimeHintsRegistrar : RuntimeHintsRegistrar { override fun registerHints( hints: RuntimeHints, - classLoader: ClassLoader?, + classLoader: ClassLoader? ) { val packages = listOf("com.valensas.ftp.model") logger.info( "Setting reflection hints for classes in packages: {}", - packages.joinToString(", "), + packages.joinToString(", ") ) TypeScanner @@ -32,7 +32,7 @@ class CustomRuntimeHintsRegistrar : RuntimeHintsRegistrar { HintUtils.registerSerializationHints( hints, clazz, - classLoader, + classLoader ) } } diff --git a/src/main/kotlin/com/valensas/ftp/hints/JschRuntimeHintsRegistrar.kt b/src/main/kotlin/com/valensas/ftp/hints/JschRuntimeHintsRegistrar.kt index 49094fb..e9f6c15 100644 --- a/src/main/kotlin/com/valensas/ftp/hints/JschRuntimeHintsRegistrar.kt +++ b/src/main/kotlin/com/valensas/ftp/hints/JschRuntimeHintsRegistrar.kt @@ -7,7 +7,7 @@ import org.springframework.aot.hint.RuntimeHintsRegistrar class JschRuntimeHintsRegistrar : RuntimeHintsRegistrar { override fun registerHints( hints: RuntimeHints, - classLoader: ClassLoader?, + classLoader: ClassLoader? ) { val reflection = hints.reflection() @@ -19,12 +19,12 @@ class JschRuntimeHintsRegistrar : RuntimeHintsRegistrar { "javax.crypto.KeyAgreement", "java.security.MessageDigest", "java.security.KeyPairGenerator", - "java.security.Signature", + "java.security.Signature" ).forEach { reflection.registerTypeIfPresent( classLoader, it, - ::configureForReflection, + ::configureForReflection ) } @@ -59,14 +59,14 @@ class JschRuntimeHintsRegistrar : RuntimeHintsRegistrar { "com.jcraft.jsch.DHG1", "com.jcraft.jsch.DHG14", "com.jcraft.jsch.DHGEX", - "com.jcraft.jsch.DHGEX256", + "com.jcraft.jsch.DHGEX256" ) jschClasses.forEach { reflection.registerTypeIfPresent( classLoader, it, - ::configureForReflection, + ::configureForReflection ) } } @@ -75,7 +75,7 @@ class JschRuntimeHintsRegistrar : RuntimeHintsRegistrar { typeHint.withMembers( MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_DECLARED_METHODS, - MemberCategory.DECLARED_FIELDS, + MemberCategory.DECLARED_FIELDS ) } } diff --git a/src/main/kotlin/com/valensas/ftp/model/ConnectionMode.kt b/src/main/kotlin/com/valensas/ftp/model/ConnectionMode.kt index 31f70f9..d1ac0ee 100644 --- a/src/main/kotlin/com/valensas/ftp/model/ConnectionMode.kt +++ b/src/main/kotlin/com/valensas/ftp/model/ConnectionMode.kt @@ -2,5 +2,5 @@ package com.valensas.ftp.model enum class ConnectionMode { Active, - Passive, + Passive } diff --git a/src/main/kotlin/com/valensas/ftp/model/ConnectionModel.kt b/src/main/kotlin/com/valensas/ftp/model/ConnectionModel.kt index 2d383ae..093d301 100644 --- a/src/main/kotlin/com/valensas/ftp/model/ConnectionModel.kt +++ b/src/main/kotlin/com/valensas/ftp/model/ConnectionModel.kt @@ -12,5 +12,5 @@ data class ConnectionModel( val connectionMode: ConnectionMode? = null, val connectionTimeout: Int? = null, val strictHostKeyChecking: String = "no", - val retryBackoffDurationsInSecond: List = listOf(0), + val retryBackoffDurationsInSecond: List = listOf(0) ) diff --git a/src/main/kotlin/com/valensas/ftp/model/ConnectionResult.kt b/src/main/kotlin/com/valensas/ftp/model/ConnectionResult.kt index d968e65..2d4783a 100644 --- a/src/main/kotlin/com/valensas/ftp/model/ConnectionResult.kt +++ b/src/main/kotlin/com/valensas/ftp/model/ConnectionResult.kt @@ -3,10 +3,10 @@ package com.valensas.ftp.model data class ConnectionResult( val connected: Boolean, val retryCount: Int = 0, - val errors: Set = emptySet(), + val errors: Set = emptySet() ) { class Error( val description: String, - val count: Int, + val count: Int ) } diff --git a/src/main/kotlin/com/valensas/ftp/model/ConnectionType.kt b/src/main/kotlin/com/valensas/ftp/model/ConnectionType.kt index b575b2c..cb27ea9 100644 --- a/src/main/kotlin/com/valensas/ftp/model/ConnectionType.kt +++ b/src/main/kotlin/com/valensas/ftp/model/ConnectionType.kt @@ -3,5 +3,5 @@ package com.valensas.ftp.model enum class ConnectionType { FTP, FTPS, - SFTP, + SFTP } diff --git a/src/main/kotlin/com/valensas/ftp/model/ConnectionVariant.kt b/src/main/kotlin/com/valensas/ftp/model/ConnectionVariant.kt index e19b97e..3078c37 100644 --- a/src/main/kotlin/com/valensas/ftp/model/ConnectionVariant.kt +++ b/src/main/kotlin/com/valensas/ftp/model/ConnectionVariant.kt @@ -2,5 +2,5 @@ package com.valensas.ftp.model enum class ConnectionVariant { Explicit, - Implicit, + Implicit } diff --git a/src/main/kotlin/com/valensas/ftp/model/FTPClient.kt b/src/main/kotlin/com/valensas/ftp/model/FTPClient.kt index 2220226..4eabc85 100644 --- a/src/main/kotlin/com/valensas/ftp/model/FTPClient.kt +++ b/src/main/kotlin/com/valensas/ftp/model/FTPClient.kt @@ -36,7 +36,7 @@ open class FTPClient : FTPClient() { return ConnectionResult( connected = connected, retryCount = retryCount, - errors = errors.groupBy { it }.map { ConnectionResult.Error(it.key, it.value.size) }.toSet(), + errors = errors.groupBy { it }.map { ConnectionResult.Error(it.key, it.value.size) }.toSet() ) } diff --git a/src/main/kotlin/com/valensas/ftp/model/FTPSClient.kt b/src/main/kotlin/com/valensas/ftp/model/FTPSClient.kt index b50747c..095be42 100644 --- a/src/main/kotlin/com/valensas/ftp/model/FTPSClient.kt +++ b/src/main/kotlin/com/valensas/ftp/model/FTPSClient.kt @@ -11,7 +11,7 @@ import javax.net.ssl.SSLException import javax.net.ssl.TrustManager class FTPSClient( - isImplicit: Boolean = false, + isImplicit: Boolean = false ) : FTPClient() { private val logger: Logger = LoggerFactory.getLogger(javaClass) @@ -86,14 +86,13 @@ class FTPSClient( @Throws(IOException::class) override fun sendCommand( command: String, - args: String?, - ): Int = - try { - ftpsClient.sendCommand(command, args) - } catch (e: Throwable) { - logger.error("An error occurred while sending command $command to the FTPS server", e) - throw e - } + args: String? + ): Int = try { + ftpsClient.sendCommand(command, args) + } catch (e: Throwable) { + logger.error("An error occurred while sending command $command to the FTPS server", e) + throw e + } @Throws(IOException::class) override fun isConnected(): Boolean = ftpsClient.isConnected diff --git a/src/main/kotlin/com/valensas/ftp/model/SFTPClient.kt b/src/main/kotlin/com/valensas/ftp/model/SFTPClient.kt index 2ccf167..788fe7c 100644 --- a/src/main/kotlin/com/valensas/ftp/model/SFTPClient.kt +++ b/src/main/kotlin/com/valensas/ftp/model/SFTPClient.kt @@ -39,30 +39,28 @@ class SFTPClient : FTPClient() { override fun retrieveFileStream(remoteFileName: String): InputStream = channel.get(remoteFileName) - override fun deleteFile(remoteFileName: String): Boolean = - try { - channel.rm(remoteFileName) - true - } catch (e: Exception) { - logger.warn("Can not delete $remoteFileName file.", e) - throw e - } + override fun deleteFile(remoteFileName: String): Boolean = try { + channel.rm(remoteFileName) + true + } catch (e: Exception) { + logger.warn("Can not delete $remoteFileName file.", e) + throw e + } override fun rename( from: String?, - to: String?, - ): Boolean = - try { - channel.rename(from, to) - true - } catch (e: Exception) { - logger.warn("Can not move file from $from to $to.", e) - throw e - } + to: String? + ): Boolean = try { + channel.rename(from, to) + true + } catch (e: Exception) { + logger.warn("Can not move file from $from to $to.", e) + throw e + } override fun storeFile( remote: String?, - local: InputStream?, + local: InputStream? ): Boolean { try { channel.put(local, remote) diff --git a/src/main/kotlin/com/valensas/ftp/server/EmbeddedFtpServer.kt b/src/main/kotlin/com/valensas/ftp/server/EmbeddedFtpServer.kt index 1a76b7b..dbfbd78 100644 --- a/src/main/kotlin/com/valensas/ftp/server/EmbeddedFtpServer.kt +++ b/src/main/kotlin/com/valensas/ftp/server/EmbeddedFtpServer.kt @@ -27,7 +27,7 @@ class EmbeddedFtpServer { isImplicit: Boolean = false, certificatePath: String? = null, path: Path? = Files.createTempDirectory("ftp-test"), - connectionConfig: ConnectionConfig? = null, + connectionConfig: ConnectionConfig? = null ) { val serverFactory = FtpServerFactory() listenerFactory = ListenerFactory() @@ -52,7 +52,7 @@ class EmbeddedFtpServer { user.password = password user.authorities = listOf( - WritePermission(), + WritePermission() ) path?.let { user.homeDirectory = it.toAbsolutePath().toString() diff --git a/src/main/kotlin/com/valensas/ftp/server/EmbeddedSftpServer.kt b/src/main/kotlin/com/valensas/ftp/server/EmbeddedSftpServer.kt index d2b2552..bb21baf 100644 --- a/src/main/kotlin/com/valensas/ftp/server/EmbeddedSftpServer.kt +++ b/src/main/kotlin/com/valensas/ftp/server/EmbeddedSftpServer.kt @@ -27,7 +27,7 @@ class EmbeddedSftpServer { path: Path? = Files.createTempDirectory("ftp-test"), clientPublicKey: PublicKey? = null, algorithm: String = "RSA", - keySize: Int = 2048, + keySize: Int = 2048 ) { sshServer = SshServer.setUpDefaultServer() val fileSystemFactory = VirtualFileSystemFactory() @@ -72,7 +72,7 @@ class EmbeddedSftpServer { private fun setProvider( algorithm: String, - keySize: Int, + keySize: Int ): SimpleGeneratorHostKeyProvider { val provider = SimpleGeneratorHostKeyProvider() provider.algorithm = algorithm diff --git a/src/test/kotlin/com/valensas/ftp/Fake.kt b/src/test/kotlin/com/valensas/ftp/Fake.kt index 48f49b6..beead44 100644 --- a/src/test/kotlin/com/valensas/ftp/Fake.kt +++ b/src/test/kotlin/com/valensas/ftp/Fake.kt @@ -1,6 +1,5 @@ package com.valensas.ftp object Fake { - fun privateKey() = - "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCGmT4IL7gjhLgm\n09Okeh8FnOfihgEoTOIxDKA2Dx9Ce+LSV36DMg4LTfZl6N78yuwIYe6AUIGDtCgD\n6g5LHT4uBQJnA/4I2B/gnJmj2DdagPwr1oqMouETomzfGtDEAJbEzMGxKK3JlIAu\nQn3PFgvbgFvlkeOvUjtEQQ7H6surKLnmKc9rRsKH7RtDh34pwx1n07AJbWX3GTr0\n7p8n3gCTLOTdtp6JzHdme8uRdO4ZPPIvaFKBRQWHN/IxcXn4yNpQqnTDFi77MmWC\nJO9AHd3LYgM328Nbo0elXcojAuqRCrxJ++ky1nZvSc8bPJDV1bHg1oj0hVmfzaXZ\n1RQu5RwFAgMBAAECggEAMS8WJ8+oLfJ1iFqnX9bwNxDa+z+UdLGDhgDjGl30Qksa\n21n1dON5lk/q1dp+gUl1bqq6iFDiwsm2RZflmTUaX56c/h/LWFgBbgZLbj+4Gm4/\nt5UyE6oBLTeRKQWXe8frUAayUJZYyuxk2oKZjm6z7oW9Dup8lLgryAkt6Ye23NgB\nSjZb8kyvW8fol8L/zSV/zxhXXYLBC54KjHLhSfZhJTvIvfm1zBS011b3nYRubn0j\n6S2ZCTe1V0NQvu5lij54cjcO14mR87FilnHh6rhfRv+Xnw50gbNvTcG6Zt7PdVCl\ntf2/EiHRZdfm7OIhV8VVLVRthyIa3SUMMZytTiHokQKBgQC3a/DTW7XsFUDyjHiE\nesg1JbaMxHN2h4IQQcn3DjXfeWE/pWhLQFkU6lzgmWjCXCPJvJFMr/+vx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JMCFRWUZ500o1Z3/Ryu3x0WylfDLOirJlQKBgCAn\nJDVOn2ySzJxLptJL7C3JPm45X3DwPKCVUUTCF+dVD5ZGC9rMzOFCaj2tO1L+PFzP\n3FdB3sQ98AGIiok7QinuUHiZOf3OJJaVWAUVDreLYyvLWOkjF88fE/E6VW0m7ScM\nsLPT3Y7WcJKcm6397MErxZOpaHzQpMpZ4sX8fSF7AoGAIDvjVsTMMFC8kBDe2GxF\nDM5GkI8rI9y7a6fxiY239zHSdNLPqi4tO/qBkP2TjMpWhVNQD7UwAc7bLMkXC28X\nEniUcKI28G0347OMgRPcnJAKHCeiFbf35+vKhrkdFh1u586UbJP8wPPIhdI+d/OC\noKMplwiuEfKeCbA378EjqSs=\n-----END PRIVATE KEY-----" } diff --git a/src/test/kotlin/com/valensas/ftp/FtpApplicationTests.kt b/src/test/kotlin/com/valensas/ftp/FtpApplicationTests.kt index d46ee9b..64a71da 100644 --- a/src/test/kotlin/com/valensas/ftp/FtpApplicationTests.kt +++ b/src/test/kotlin/com/valensas/ftp/FtpApplicationTests.kt @@ -48,7 +48,7 @@ class FtpApplicationTests { Fake.privateKey(), null, ConnectionMode.Passive, - 6000, + 6000 ) client.authAndConnect(connectionModel) server.stop() @@ -65,7 +65,7 @@ class FtpApplicationTests { ConnectionType.FTPS, isImplicit = true, certificatePath = "src/test/resources/ftps-test-cert.jks", - port = getRandomFreePort(), + port = getRandomFreePort() ) val connectionModel = ConnectionModel( @@ -78,7 +78,7 @@ class FtpApplicationTests { Fake.privateKey(), null, ConnectionMode.Passive, - 6000, + 6000 ) val client = ftpClientFactory.createFtpClient(ConnectionType.FTPS, ConnectionVariant.Implicit) client.authAndConnect(connectionModel) @@ -96,7 +96,7 @@ class FtpApplicationTests { ConnectionType.FTPS, isImplicit = false, certificatePath = "src/test/resources/ftps-test-cert.jks", - port = getRandomFreePort(), + port = getRandomFreePort() ) val connectionModel = ConnectionModel( @@ -109,7 +109,7 @@ class FtpApplicationTests { Fake.privateKey(), null, ConnectionMode.Passive, - 6000, + 6000 ) val client = ftpClientFactory.createFtpClient(ConnectionType.FTPS, ConnectionVariant.Explicit) client.authAndConnect(connectionModel) @@ -135,8 +135,8 @@ class FtpApplicationTests { privateKey = keys.private.toPEM(), null, ConnectionMode.Passive, - 6000, - ), + 6000 + ) ) assertTrue(client.isConnected) client.disconnect() @@ -162,8 +162,8 @@ class FtpApplicationTests { privateKey = keys.private.toPEM(), null, ConnectionMode.Passive, - 6000, - ), + 6000 + ) ) assertTrue(client.isConnected) client.disconnect() @@ -189,8 +189,8 @@ class FtpApplicationTests { privateKey = keys.private.toPEM(), null, ConnectionMode.Passive, - 6000, - ), + 6000 + ) ) assertFalse(result.connected) assertFalse(client.isConnected) @@ -216,8 +216,8 @@ class FtpApplicationTests { Fake.privateKey(), null, ConnectionMode.Passive, - 6000, - ), + 6000 + ) ) assertFalse(connectionResult.connected) } @@ -240,8 +240,8 @@ class FtpApplicationTests { Fake.privateKey(), null, null, - 6000, - ), + 6000 + ) ) assertFalse(result.connected) assertFalse(client.isConnected) @@ -267,8 +267,8 @@ class FtpApplicationTests { Fake.privateKey(), null, null, - 6000, - ), + 6000 + ) ) val fileName = UUID.randomUUID().toString() client.storeFile(fileName, inputStream) @@ -297,8 +297,8 @@ class FtpApplicationTests { Fake.privateKey(), null, null, - 6000, - ), + 6000 + ) ) val fileName = UUID.randomUUID().toString() client.storeFile(fileName, inputStream) @@ -331,8 +331,8 @@ class FtpApplicationTests { Fake.privateKey(), null, ConnectionMode.Passive, - 6000, - ), + 6000 + ) ) assertTrue(client.isConnected) assertNotNull(client.listDirectories(".")) @@ -358,8 +358,8 @@ class FtpApplicationTests { Fake.privateKey(), null, ConnectionMode.Passive, - 6000, - ), + 6000 + ) ) Assertions.assertTrue(client.isConnected) val dir = "test/test2/test3" @@ -381,7 +381,7 @@ class FtpApplicationTests { ConnectionType.FTPS, isImplicit = false, certificatePath = "src/test/resources/ftps-test-cert.jks", - port = port, + port = port ) val connectionModel = ConnectionModel( @@ -395,7 +395,7 @@ class FtpApplicationTests { null, ConnectionMode.Passive, 6000, - retryBackoffDurationsInSecond = listOf(1, 2, 3), + retryBackoffDurationsInSecond = listOf(1, 2, 3) ) val client = ftpClientFactory.createFtpClient(ConnectionType.FTPS, ConnectionVariant.Explicit) val spyClient = spy(client) @@ -414,7 +414,7 @@ class FtpApplicationTests { private fun generatePublicKey( keySize: Int = 2048, - algorithm: String = "RSA", + algorithm: String = "RSA" ): KeyPair { val generator = KeyPairGenerator.getInstance(algorithm) generator.initialize(keySize) From b678b2265ca7a2530c06ce7f9e1f6f5ad74c3939 Mon Sep 17 00:00:00 2001 From: Okan Okumusoglu Date: Wed, 17 Jun 2026 15:08:14 +0300 Subject: [PATCH 2/2] upgrade graalvm dependency --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2ae54df..24f049a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,7 +34,7 @@ dependencies { testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.jetbrains.kotlin:kotlin-test-junit5") testRuntimeOnly("org.junit.platform:junit-platform-launcher") - implementation("com.valensas:graalvm-native-support:1.0.8") + implementation("com.valensas:graalvm-native-support:1.1.0") // Ftp implementation("commons-net:commons-net:3.13.0")