Skip to content

Commit

Permalink
fix: use resource contents directly
Browse files Browse the repository at this point in the history
  • Loading branch information
jenspots committed May 30, 2024
1 parent adacfeb commit fa1b367
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
/** JVM Runner configuration. */
group = "technology.idlab"

version = "0.0.3"
version = "0.0.4"

/** Set the Kotlin JVM version to 17. */
kotlin { jvmToolchain(17) }
Expand Down
13 changes: 6 additions & 7 deletions src/main/kotlin/parser/Parser.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ class Parser(file: File) {
private val model =
this::class
.java
.getResource("/pipeline.ttl")
.let { it ?: Log.shared.fatal("Pipeline file not found") }
.getResourceAsStream("/pipeline.ttl")
.let { it ?: Log.shared.fatal("Pipeline ontology not found") }
.readAllBytes()
.let {
try {
File(it.path)
} catch (e: Exception) {
Log.shared.fatal("Pipeline ${it.path} not found")
}
val f = File.createTempFile("pipeline", ".ttl")
f.writeBytes(it)
return@let f
}
.readModelRecursively()

Expand Down

0 comments on commit fa1b367

Please sign in to comment.