From c72d110d304926aab82296de27b136cbe4a4f1a0 Mon Sep 17 00:00:00 2001 From: Emily McMullan Date: Mon, 9 Dec 2024 17:09:40 -0500 Subject: [PATCH] remove \ from java bundle for windows Signed-off-by: Emily McMullan --- .../pkg/java_external_provider/filter.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/external-providers/java-external-provider/pkg/java_external_provider/filter.go b/external-providers/java-external-provider/pkg/java_external_provider/filter.go index 2dbd7d73..2ce8d519 100644 --- a/external-providers/java-external-provider/pkg/java_external_provider/filter.go +++ b/external-providers/java-external-provider/pkg/java_external_provider/filter.go @@ -7,6 +7,7 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "strconv" "strings" @@ -198,6 +199,11 @@ func (p *javaServiceClient) getURI(refURI string) (string, uri.URI, error) { jarPath = filepath.Join(filepath.Dir(u.Path), jarName) } + // these are added in bundle + if runtime.GOOS == "windows" { + jarPath = strings.TrimPrefix(jarPath, "\\") + } + path := filepath.Join(strings.Split(strings.TrimSuffix(packageName, ".class"), ".")...) // path: org/apache/logging/log4j/core/appender/FileManager javaFileName := fmt.Sprintf("%s.java", filepath.Base(path))