Detect returns a positive result if loadConfig() finds settings (universal framework for JAVA_OPTS configuration)
()
| 26 | |
| 27 | // Detect returns a positive result if loadConfig() finds settings (universal framework for JAVA_OPTS configuration) |
| 28 | func (j *JavaOptsFramework) Detect() (string, error) { |
| 29 | // Check if there's any configuration to apply |
| 30 | config, err := j.loadConfig() |
| 31 | if err != nil { |
| 32 | // if detect "fails" Finalize() is not called so log parse failures as warning |
| 33 | j.context.Log.Warning("Failed to load java_opts config: %s", err.Error()) |
| 34 | return "", nil |
| 35 | } |
| 36 | |
| 37 | // Detect if there are any custom java_opts or if from_environment is enabled |
| 38 | if len(config.JavaOpts) > 0 || config.FromEnvironment { |
| 39 | return "Java Opts", nil |
| 40 | } |
| 41 | |
| 42 | return "", nil |
| 43 | } |
| 44 | |
| 45 | // Supply does nothing (no dependencies to install) |
| 46 | func (j *JavaOptsFramework) Supply() error { |
nothing calls this directly
no test coverage detected