diff --git a/build.sbt b/build.sbt index 57743ca0..c13fd0b7 100644 --- a/build.sbt +++ b/build.sbt @@ -14,7 +14,7 @@ val pekkoConnectorKafkaVersion = "1.1.0" val kafkaVersion = "3.8.0" val activemqVersion = "5.18.5" // We are stuck with 5.x val artemisVersion = "2.37.0" -val testContainersVersion = "1.20.1" +val testContainersVersion = "1.20.4" val keycloakVersion = "26.0.1" val sttpVersion = "3.9.0" val influxdbVersion = "7.1.0" @@ -98,7 +98,7 @@ libraryDependencies ++= Seq( "ca.uhn.hapi" % "hapi-structures-v25" % "2.3", "ca.uhn.hapi" % "hapi-structures-v281" % "2.3", - "org.apache.opennlp" % "opennlp-tools" % "2.3.3", + "org.apache.opennlp" % "opennlp-tools" % "2.5.0", "org.apache.httpcomponents.client5" % "httpclient5" % "5.4", "org.apache.httpcomponents.core5" % "httpcore5" % "5.3", @@ -114,8 +114,6 @@ libraryDependencies ++= Seq( "com.github.blemale" %% "scaffeine" % "5.3.0", "ch.qos.logback" % "logback-classic" % "1.4.12", - "org.apache.tika" % "tika-core" % "2.9.2", - "org.testcontainers" % "testcontainers" % testContainersVersion, "org.testcontainers" % "elasticsearch" % testContainersVersion, "org.testcontainers" % "rabbitmq" % testContainersVersion, diff --git a/project/build.properties b/project/build.properties index c7450fc2..2a577eee 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.5 \ No newline at end of file +sbt.version=1.10.6 \ No newline at end of file diff --git a/src/main/scala/alpakka/file/uploader/Uploader.scala b/src/main/scala/alpakka/file/uploader/Uploader.scala index 4f0b532f..fd02bcc6 100644 --- a/src/main/scala/alpakka/file/uploader/Uploader.scala +++ b/src/main/scala/alpakka/file/uploader/Uploader.scala @@ -10,10 +10,10 @@ import org.apache.pekko.http.scaladsl.server.Route import org.apache.pekko.http.scaladsl.server.directives.FileInfo import org.apache.pekko.http.scaladsl.settings.ConnectionPoolSettings import org.apache.pekko.stream.scaladsl.FileIO -import org.apache.tika.Tika import org.slf4j.{Logger, LoggerFactory} import java.io.File +import java.nio.file.Files import scala.concurrent.duration.* import scala.concurrent.{Await, ExecutionContextExecutor, Future} import scala.util.{Failure, Success} @@ -104,8 +104,7 @@ class Uploader(system: ActorSystem) { } def detectMediaType(file: File): ContentType = { - val tika = new Tika() - val detectedMediaType = tika.detect(file) + val detectedMediaType = Files.probeContentType(file.toPath) logger.info(s"Detected media type: $detectedMediaType") ContentType.parse(detectedMediaType) match { diff --git a/src/main/scala/alpakka/sse_to_elasticsearch/SSEtoElasticsearch.scala b/src/main/scala/alpakka/sse_to_elasticsearch/SSEtoElasticsearch.scala index 19072e8e..5141da50 100644 --- a/src/main/scala/alpakka/sse_to_elasticsearch/SSEtoElasticsearch.scala +++ b/src/main/scala/alpakka/sse_to_elasticsearch/SSEtoElasticsearch.scala @@ -93,7 +93,7 @@ object SSEtoElasticsearch extends App { // elasticsearchContainer.start() private val dockerImageNameOS = DockerImageName .parse("opensearchproject/opensearch") - .withTag("1.3.16") + .withTag("1.3.19") private val searchContainer = new OpensearchContainer(dockerImageNameOS) searchContainer.start()