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

Function GetResource

src/java/resources/embed.go:19–26  ·  view source on GitHub ↗

GetResource reads a single embedded resource file path is relative to files/ directory (e.g., "tomcat/conf/server.xml")

(path string)

Source from the content-addressed store, hash-verified

17// GetResource reads a single embedded resource file
18// path is relative to files/ directory (e.g., "tomcat/conf/server.xml")
19func GetResource(path string) ([]byte, error) {
20 fullPath := filepath.Join("files", path)
21 data, err := EmbeddedResources.ReadFile(fullPath)
22 if err != nil {
23 return nil, fmt.Errorf("failed to read embedded resource %s: %w", path, err)
24 }
25 return data, nil
26}
27
28// ExtractToDir extracts all embedded resources to the target directory
29// Preserves directory structure relative to files/

Calls

no outgoing calls

Tested by

no test coverage detected