mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-26 00:17:11 -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
|
||||
}
|
||||
|
||||
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 {
|
||||
|
|
|
@ -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 = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue