Skip to content

Commit

Permalink
support local ui zip by system property
Browse files Browse the repository at this point in the history
  • Loading branch information
shalom938 committed Dec 10, 2024
1 parent 70e30c4 commit f1b3839
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import java.util.zip.ZipFile
@Service(Service.Level.APP)
class UIResourcesService {

//todo: override zip location with system property

private val logger = Logger.getInstance(this::class.java)

Expand Down Expand Up @@ -47,7 +46,7 @@ class UIResourcesService {
fun isResourceExists(resourcePath: String): Boolean {
waitForUiStartupToComplete()

val uiBundlePath = UIVersioningService.getInstance().currentUiBundlePath
val uiBundlePath = getUIBundlePath()

return ZipFile(uiBundlePath).use { zipFile ->
val entry = zipFile.getEntry(resourcePath)
Expand All @@ -58,7 +57,7 @@ class UIResourcesService {
fun getResourceAsStream(resourcePath: String): InputStream? {
waitForUiStartupToComplete()

val uiBundlePath = UIVersioningService.getInstance().currentUiBundlePath
val uiBundlePath = getUIBundlePath()

return ZipFile(uiBundlePath).use { zipFile ->
val entry = zipFile.getEntry(resourcePath)
Expand All @@ -76,4 +75,10 @@ class UIResourcesService {
}
}


private fun getUIBundlePath():String{
//todo: support also downloading from url
return System.getProperty("org.digma.plugin.ui.bundle.path") ?:UIVersioningService.getInstance().currentUiBundlePath
}

}

0 comments on commit f1b3839

Please sign in to comment.