mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 16:28:12 -07:00
Unnecessary classLoader.
This commit is contained in:
parent
b23cd94422
commit
35e0167a1f
2 changed files with 4 additions and 4 deletions
|
@ -39,11 +39,11 @@ abstract class ResourceJarTemplate(jarName: String, val classLoader: ClassLoader
|
||||||
override val inputStream : InputStream = classLoader.getResource(jarName).openConnection().inputStream
|
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))
|
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
|
override val inputStream : InputStream
|
||||||
get() {
|
get() {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -28,13 +28,13 @@ class ProjectGenerator @Inject constructor(val pluginInfo: PluginInfo){
|
||||||
val finalTemplate: ITemplate? = map[templateName]
|
val finalTemplate: ITemplate? = map[templateName]
|
||||||
?: if (File(templateName).exists()) {
|
?: if (File(templateName).exists()) {
|
||||||
kobaltLog(2, "Found a template jar file at $templateName, extracting it")
|
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 templateDescription = "Extract jar template from file"
|
||||||
override val templateName = "File template"
|
override val templateName = "File template"
|
||||||
override val pluginName = ""
|
override val pluginName = ""
|
||||||
}
|
}
|
||||||
} else if (templateName.startsWith("http://") || templateName.startsWith("https://")) {
|
} 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 templateDescription = "Extract jar template from HTTP"
|
||||||
override val templateName = "HTTP template"
|
override val templateName = "HTTP template"
|
||||||
override val pluginName = ""
|
override val pluginName = ""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue