From 35e0167a1fe06274b726e730ce2ec9123765e84b Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Mon, 20 Feb 2017 07:22:44 -0800 Subject: [PATCH] Unnecessary classLoader. --- .../kotlin/com/beust/kobalt/api/InputStreamJarTemplate.kt | 4 ++-- src/main/kotlin/com/beust/kobalt/app/ProjectGenerator.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/InputStreamJarTemplate.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/InputStreamJarTemplate.kt index b2c9d513..222a2829 100644 --- a/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/InputStreamJarTemplate.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/InputStreamJarTemplate.kt @@ -39,11 +39,11 @@ abstract class ResourceJarTemplate(jarName: String, val classLoader: ClassLoader override val inputStream : InputStream = classLoader.getResource(jarName).openConnection().inputStream } -abstract class FileJarTemplate(val fileName: String, val classLoader: ClassLoader) : InputStreamJarTemplate { +abstract class FileJarTemplate(val fileName: String) : InputStreamJarTemplate { override val inputStream = FileInputStream(File(fileName)) } -abstract class HttpJarTemplate(val url: String, val classLoader: ClassLoader) : InputStreamJarTemplate { +abstract class HttpJarTemplate(val url: String) : InputStreamJarTemplate { override val inputStream : InputStream get() { try { diff --git a/src/main/kotlin/com/beust/kobalt/app/ProjectGenerator.kt b/src/main/kotlin/com/beust/kobalt/app/ProjectGenerator.kt index 4f33ee32..0f6fb841 100644 --- a/src/main/kotlin/com/beust/kobalt/app/ProjectGenerator.kt +++ b/src/main/kotlin/com/beust/kobalt/app/ProjectGenerator.kt @@ -28,13 +28,13 @@ class ProjectGenerator @Inject constructor(val pluginInfo: PluginInfo){ val finalTemplate: ITemplate? = map[templateName] ?: if (File(templateName).exists()) { kobaltLog(2, "Found a template jar file at $templateName, extracting it") - object : FileJarTemplate(templateName, classLoader) { + object : FileJarTemplate(templateName) { override val templateDescription = "Extract jar template from file" override val templateName = "File template" override val pluginName = "" } } else if (templateName.startsWith("http://") || templateName.startsWith("https://")) { - object : HttpJarTemplate(templateName, classLoader) { + object : HttpJarTemplate(templateName) { override val templateDescription = "Extract jar template from HTTP" override val templateName = "HTTP template" override val pluginName = ""