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