/** * @deprecated * Use {@link CLIConnectionFactory} to create {@link CLI} */ @Deprecated public CLI(URL jenkins, ExecutorService exec, String httpsProxyTunnel) throws IOException, InterruptedException { this(new CLIConnectionFactory().url(jenkins).executorService(exec).httpsProxyTunnel(httpsProxyTunnel)); }
/** * Convenience method to call {@link #authorization} with the HTTP basic authentication. * Currently unused. */ public CLIConnectionFactory basicAuth(String username, String password) { return basicAuth(username+':'+password); }
CLIConnectionFactory factory = new CLIConnectionFactory().url(url).httpsProxyTunnel(httpProxy); String userInfo = new URL(url).getUserInfo(); if (userInfo != null) { factory = factory.basicAuth(userInfo); } else if (auth != null) { factory = factory.basicAuth(auth.startsWith("@") ? FileUtils.readFileToString(new File(auth.substring(1))).trim() : auth); CLI cli = factory.connect(); try { if (provider.hasKeys()) {
public CLIConnectionFactory url(String jenkins) throws MalformedURLException { return url(new URL(jenkins)); }
/** * Convenience method to call {@link #authorization} with the HTTP basic authentication. * Cf. {@code BasicHeaderApiTokenAuthenticator}. */ public CLIConnectionFactory basicAuth(String userInfo) { return authorization("Basic " + new String(Base64.encodeBase64((userInfo).getBytes()))); }