MCPcopy Index your code
hub / github.com/cloudfoundry/java-buildpack / createJar

Function createJar

src/java/containers/java_main_test.go:17–31  ·  view source on GitHub ↗

createJar writes a JAR file at jarPath containing META-INF/MANIFEST.MF with the given content.

(jarPath, manifestContent string)

Source from the content-addressed store, hash-verified

15
16// createJar writes a JAR file at jarPath containing META-INF/MANIFEST.MF with the given content.
17func createJar(jarPath, manifestContent string) error {
18 buf := new(bytes.Buffer)
19 w := zip.NewWriter(buf)
20 f, err := w.Create("META-INF/MANIFEST.MF")
21 if err != nil {
22 return err
23 }
24 if _, err := f.Write([]byte(manifestContent)); err != nil {
25 return err
26 }
27 if err := w.Close(); err != nil {
28 return err
29 }
30 return os.WriteFile(jarPath, buf.Bytes(), 0644)
31}
32
33var _ = Describe("Java Main Container", func() {
34 var (

Callers 2

java_main_test.goFile · 0.85

Calls 1

WriteMethod · 0.80

Tested by

no test coverage detected