Commit 3204f204 authored by Him188's avatar Him188

Close stream after read

parent ab0cecaf
...@@ -126,7 +126,9 @@ object PluginManager { ...@@ -126,7 +126,9 @@ object PluginManager {
logger.info("plugin.yml not found in jar " + jar.name + ", it will not be consider as a Plugin") logger.info("plugin.yml not found in jar " + jar.name + ", it will not be consider as a Plugin")
} else { } else {
val description = val description =
PluginDescription.readFromContent(URL("jar:file:" + file.absoluteFile + "!/" + pluginYml.name).openConnection().inputStream.readBytes().encodeToString()) PluginDescription.readFromContent(URL("jar:file:" + file.absoluteFile + "!/" + pluginYml.name).openConnection().inputStream.use {
it.readBytes().encodeToString()
})
println(description) println(description)
pluginsFound[description.name] = description pluginsFound[description.name] = description
pluginsLocation[description.name] = file pluginsLocation[description.name] = file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment