From 288d38761025856fdb604610cc4c0707e1ff8512 Mon Sep 17 00:00:00 2001 From: Josef Cacek Date: Mon, 28 Sep 2015 11:20:30 +0200 Subject: [PATCH] Format code of DockerUntrustedSSLContextSupplier to fit jclouds code conventions and checkstyle settings --- .../DockerUntrustedSSLContextSupplier.java | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/apis/docker/src/main/java/org/jclouds/docker/suppliers/DockerUntrustedSSLContextSupplier.java b/apis/docker/src/main/java/org/jclouds/docker/suppliers/DockerUntrustedSSLContextSupplier.java index 42efa13da3..880a48a839 100644 --- a/apis/docker/src/main/java/org/jclouds/docker/suppliers/DockerUntrustedSSLContextSupplier.java +++ b/apis/docker/src/main/java/org/jclouds/docker/suppliers/DockerUntrustedSSLContextSupplier.java @@ -33,32 +33,33 @@ import static com.google.common.base.Throwables.propagate; @Singleton public class DockerUntrustedSSLContextSupplier implements Supplier { - private final Supplier creds; - private final SSLModule.TrustAllCerts insecureTrustManager; + private final Supplier creds; + private final SSLModule.TrustAllCerts insecureTrustManager; + @Inject + DockerUntrustedSSLContextSupplier(@Provider Supplier creds, + SSLModule.TrustAllCerts insecureTrustManager) { + this.creds = creds; + this.insecureTrustManager = insecureTrustManager; + } - @Inject - DockerUntrustedSSLContextSupplier(@Provider Supplier creds, SSLModule.TrustAllCerts insecureTrustManager) { - this.creds = creds; - this.insecureTrustManager = insecureTrustManager; - } - - @Override - public SSLContext get() { - Credentials currentCreds = creds.get(); - try { - SSLContextBuilder builder = new SSLContextBuilder(); - // check if identity and credential are files, to set up sslContext - if (currentCreds!=null && new File(currentCreds.identity).isFile() && new File(currentCreds.credential).isFile()) { - builder.clientKeyAndCertificate(currentCreds.credential, currentCreds.identity); - } - builder.trustManager(insecureTrustManager); - return builder.build(); - } catch (GeneralSecurityException e) { - throw propagate(e); - } catch (IOException e) { - throw propagate(e); - } - } + @Override + public SSLContext get() { + Credentials currentCreds = creds.get(); + try { + SSLContextBuilder builder = new SSLContextBuilder(); + // check if identity and credential are files, to set up sslContext + if (currentCreds != null && new File(currentCreds.identity).isFile() + && new File(currentCreds.credential).isFile()) { + builder.clientKeyAndCertificate(currentCreds.credential, currentCreds.identity); + } + builder.trustManager(insecureTrustManager); + return builder.build(); + } catch (GeneralSecurityException e) { + throw propagate(e); + } catch (IOException e) { + throw propagate(e); + } + } }