Search in sources :

Example 1 with MavenDecrypter

use of org.talend.sdk.component.maven.MavenDecrypter in project component-runtime by Talend.

the class BaseMavenDecrypter method createInstance.

public Server createInstance(final DecryptedServer config) {
    if (config.alwaysTryLookup()) {
        try {
            return new MavenDecrypter().find(config.value());
        } catch (final IllegalArgumentException iae) {
            if (ifActive(config.conditions())) {
                throw iae;
            }
        }
    } else if (ifActive(config.conditions())) {
        return new MavenDecrypter().find(config.value());
    }
    final Server server = new Server();
    server.setUsername(config.defaultUsername());
    server.setPassword(config.defaultPassword());
    return server;
}
Also used : DecryptedServer(org.talend.sdk.component.api.DecryptedServer) Server(org.talend.sdk.component.maven.Server) MavenDecrypter(org.talend.sdk.component.maven.MavenDecrypter)

Example 2 with MavenDecrypter

use of org.talend.sdk.component.maven.MavenDecrypter in project component-runtime by Talend.

the class Github method main.

public static void main(final String[] args) {
    final Server server = new MavenDecrypter().find("github");
    final Collection<Contributor> contributors = new Github(server.getUsername(), server.getPassword()).load();
    System.out.println(contributors);
}
Also used : Server(org.talend.sdk.component.maven.Server) MavenDecrypter(org.talend.sdk.component.maven.MavenDecrypter)

Aggregations

MavenDecrypter (org.talend.sdk.component.maven.MavenDecrypter)2 Server (org.talend.sdk.component.maven.Server)2 DecryptedServer (org.talend.sdk.component.api.DecryptedServer)1