add some logging
This commit is contained in:
@@ -71,6 +71,7 @@ object Extension {
|
||||
suspend fun installExternalExtension(inputStream: InputStream, apkName: String): Int {
|
||||
return installAPK {
|
||||
val savePath = "${applicationDirs.extensionsRoot}/$apkName"
|
||||
logger.debug { "Saving apk at $apkName" }
|
||||
// download apk file
|
||||
val downloadedFile = File(savePath)
|
||||
downloadedFile.sink().buffer().use { sink ->
|
||||
|
||||
@@ -141,6 +141,7 @@ object PackageTools {
|
||||
* It may return an instance of HttpSource or SourceFactory depending on the extension.
|
||||
*/
|
||||
fun loadExtensionSources(jarPath: String, className: String): Any {
|
||||
logger.debug { "loading jar with path: $jarPath" }
|
||||
val classLoader = URLClassLoader(arrayOf<URL>(URL("file:$jarPath")))
|
||||
val classToLoad = Class.forName(className, false, classLoader)
|
||||
return classToLoad.getDeclaredConstructor().newInstance()
|
||||
|
||||
Reference in New Issue
Block a user