Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Commit

Permalink
fix reading of kweb_bootstrap.html resource
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Jan 27, 2017
1 parent 001cc22 commit 45b957c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 28 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ dependencies {
//compile 'org.jetbrains.kotlinx:vertx3-lang-kotlin:0.0.+'
compile 'com.github.salomonbrys.kotson:kotson:2.3.0'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.0'

compile group: 'commons-io', name: 'commons-io', version: '2.5'

compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// complie "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile 'org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:0.3-beta'
Expand Down
6 changes: 2 additions & 4 deletions src/main/kotlin/com/github/sanity/kweb/KWeb.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ package com.github.sanity.kweb
import com.github.sanity.kweb.plugins.KWebPlugin
import io.netty.channel.Channel
import io.netty.handler.codec.http.websocketx.TextWebSocketFrame
import org.apache.commons.io.IOUtils
import org.wasabifx.wasabi.app.AppConfiguration
import org.wasabifx.wasabi.app.AppServer
import org.wasabifx.wasabi.protocol.websocket.respond
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import java.nio.file.Paths
import java.util.*
import java.util.concurrent.ConcurrentHashMap

Expand Down Expand Up @@ -48,7 +46,7 @@ class KWeb(val port: Int,
applyPlugin(plugin, appliedPlugins, endHeadBuilder, startHeadBuilder)
}

val bootstrapHtml = String(Files.readAllBytes(Paths.get(javaClass.getResource("kweb_bootstrap.html").toURI())), StandardCharsets.UTF_8)
val bootstrapHtml = IOUtils.toString(javaClass.getResourceAsStream("kweb_bootstrap.html"), Charsets.UTF_8)
.replace("<!-- START HEADER PLACEHOLDER -->", startHeadBuilder.toString())
.replace("<!-- END HEADER PLACEHOLDER -->", endHeadBuilder.toString())

Expand Down
23 changes: 0 additions & 23 deletions src/main/resources/com/github/sanity/kweb/client_conduit.xhtml

This file was deleted.

0 comments on commit 45b957c

Please sign in to comment.