Class ConnectorConfigReader


  • public class ConnectorConfigReader
    extends Object
    Reads and queries connector-config.json from the project source tree.

    Expected location: src/main/wso2mi/resources/connectors/connector-config.json relative to the project base directory.

    • Method Detail

      • read

        public static ConnectorConfig read​(String projectBasePath)
        Reads and parses connector-config.json from the given project base directory.
        Parameters:
        projectBasePath - absolute path to the Maven project root (where pom.xml lives)
        Returns:
        parsed ConnectorConfig, or null if the file does not exist or cannot be parsed
      • findOverride

        public static DependencyOverride findOverride​(ConnectorConfig config,
                                                      String connectorArtifactId,
                                                      String connectionType,
                                                      String groupId,
                                                      String artifactId)
        Finds the best-matching DependencyOverride for the given dependency.

        Matching priority:

        1. Match by connectionType if non-null and the override has a matching connectionType.
        2. Match by groupId + artifactId if the override has no connectionType but coordinates match.
        Parameters:
        config - the parsed connector config (may be null)
        connectorArtifactId - Maven artifactId of the connector ZIP (e.g. "mi-connector-file")
        connectionType - connectionType from descriptor.yml (may be null)
        groupId - dependency groupId from descriptor.yml
        artifactId - dependency artifactId from descriptor.yml
        Returns:
        the matching override, or null if none found