From 2742d620bb9391896569876d31f5f3c65f1e9354 Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Fri, 13 Dec 2024 11:59:00 +0100 Subject: [PATCH] Remove unused class --- .../engine/testing/ModelJarBuilder.scala | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/testing/ModelJarBuilder.scala diff --git a/scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/testing/ModelJarBuilder.scala b/scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/testing/ModelJarBuilder.scala deleted file mode 100644 index 1d387649594..00000000000 --- a/scenario-compiler/src/main/scala/pl/touk/nussknacker/engine/testing/ModelJarBuilder.scala +++ /dev/null @@ -1,35 +0,0 @@ -package pl.touk.nussknacker.engine.testing - -import java.io.{File, FileOutputStream} -import java.nio.charset.StandardCharsets -import java.nio.file.Files -import java.util.jar.{JarEntry, JarOutputStream} -import pl.touk.nussknacker.engine.api.process.ProcessConfigCreator - -import scala.reflect.ClassTag -import scala.util.Using - -object ModelJarBuilder { - - // mainly for testing - def buildJarWithConfigCreator[T <: ProcessConfigCreator: ClassTag]( - outputFile: File = Files.createTempFile("creator", ".jar").toFile - ): File = { - val output = new FileOutputStream(outputFile) - Using.resource(new JarOutputStream(output)) { jarOutput => - putToJar( - jarOutput, - "META-INF/services/pl.touk.nussknacker.engine.api.process.ProcessConfigCreator", - implicitly[ClassTag[T]].runtimeClass.getName.getBytes(StandardCharsets.UTF_8) - ) - } - outputFile - } - - private def putToJar(jarOutputStream: JarOutputStream, name: String, bytes: Array[Byte]) = { - val entry = new JarEntry(name) - jarOutputStream.putNextEntry(entry) - jarOutputStream.write(bytes) - } - -}