MCPcopy Create free account
hub / github.com/apache/camel-k / Extract

Method Extract

pkg/util/source/inspector_java_source.go:39–59  ·  view source on GitHub ↗

Extract extracts all metadata from source spec.

(source v1.SourceSpec, meta *Metadata)

Source from the content-addressed store, hash-verified

37
38// Extract extracts all metadata from source spec.
39func (i JavaSourceInspector) Extract(source v1.SourceSpec, meta *Metadata) error {
40 from := util.FindAllDistinctStringSubmatch(
41 source.Content,
42 doubleQuotedFrom,
43 doubleQuotedFromF,
44 )
45 to := util.FindAllDistinctStringSubmatch(
46 source.Content,
47 doubleQuotedTo,
48 doubleQuotedToD,
49 doubleQuotedToF,
50 doubleQuotedWireTap,
51 )
52 kameletEips := util.FindAllDistinctStringSubmatch(
53 source.Content,
54 doubleQuotedKameletEip)
55
56 hasRest := restRegexp.MatchString(source.Content)
57
58 return i.extract(source, meta, from, to, kameletEips, hasRest)
59}
60
61// ReplaceFromURI parses the source content and replace the `from` URI configuration with the a new URI. Returns true if it applies a replacement.
62func (i JavaSourceInspector) ReplaceFromURI(source *v1.SourceSpec, newFromURI string) (bool, error) {

Callers

nothing calls this directly

Calls 2

extractMethod · 0.80

Tested by

no test coverage detected