From 1c2b7392e444d589000879d6fe6f8b37df51b564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20K=C3=B6rber?= Date: Thu, 9 Jun 2016 22:56:13 +0200 Subject: [PATCH] Minor formatting fixes --- .../src/main/java/org/shredzone/acme4j/AcmeClient.java | 7 ++----- .../main/java/org/shredzone/acme4j/CertificateURIs.java | 7 ++----- .../java/org/shredzone/acme4j/impl/AbstractAcmeClient.java | 7 +++---- .../java/org/shredzone/acme4j/util/CertificateUtils.java | 3 ++- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/AcmeClient.java b/acme4j-client/src/main/java/org/shredzone/acme4j/AcmeClient.java index 6a122903..89320a5b 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/AcmeClient.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/AcmeClient.java @@ -135,7 +135,8 @@ public interface AcmeClient { * {@link Registration} to be used for conversation * @param csr * PKCS#10 Certificate Signing Request to be sent to the server - * @return {@link CertificateURIs} the certificate and certificate chain can be downloaded from + * @return {@link CertificateURIs} the certificate and certificate chain can be + * downloaded from */ CertificateURIs requestCertificate(Registration registration, byte[] csr) throws AcmeException; @@ -145,10 +146,6 @@ public interface AcmeClient { * @param chainCertUri * Certificate {@link URI} * @return Downloaded {@link X509Certificate[]} - * - * @throws AcmeException - * if an {@link IOException} is thrown during certificate retrieval - * or the max recursion limit is exceeded */ X509Certificate[] downloadCertificateChain(URI chainCertUri) throws AcmeException; diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/CertificateURIs.java b/acme4j-client/src/main/java/org/shredzone/acme4j/CertificateURIs.java index 886e3f35..cd874e08 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/CertificateURIs.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/CertificateURIs.java @@ -19,7 +19,6 @@ import java.net.URI; * Represents the URIs returned by a certificate request * * @author cargy - * */ public class CertificateURIs { @@ -34,8 +33,7 @@ public class CertificateURIs { /** * The URI from which the client may fetch the certificate * - * @return - * {@link URI} the certificate can be downloaded from + * @return {@link URI} the certificate can be downloaded from */ public URI getCertUri() { return certUri; @@ -44,8 +42,7 @@ public class CertificateURIs { /** * The URI from which the client may fetch a chain of CA certificates * - * @return - * {@link URI} the certificate chain can be downloaded from + * @return {@link URI} the certificate chain can be downloaded from */ public URI getChainCertUri() { return chainCertUri; diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/impl/AbstractAcmeClient.java b/acme4j-client/src/main/java/org/shredzone/acme4j/impl/AbstractAcmeClient.java index 19990064..06beadd8 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/impl/AbstractAcmeClient.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/impl/AbstractAcmeClient.java @@ -446,7 +446,7 @@ public abstract class AbstractAcmeClient implements AcmeClient { public X509Certificate[] downloadCertificateChain(URI chainCertUri) throws AcmeException { if (chainCertUri == null) { throw new NullPointerException("certChainUri must not be null"); - } + } LOG.debug("getCertificateChain"); @@ -461,9 +461,8 @@ public abstract class AbstractAcmeClient implements AcmeClient { certChain.add(conn.readCertificate()); link = conn.getLink("up"); - } catch (IOException ex) { - throw new AcmeNetworkException(ex); - } + } catch (IOException ex) { + throw new AcmeNetworkException(ex); } } if (link != null) { diff --git a/acme4j-utils/src/main/java/org/shredzone/acme4j/util/CertificateUtils.java b/acme4j-utils/src/main/java/org/shredzone/acme4j/util/CertificateUtils.java index 54af90fe..2a012f79 100644 --- a/acme4j-utils/src/main/java/org/shredzone/acme4j/util/CertificateUtils.java +++ b/acme4j-utils/src/main/java/org/shredzone/acme4j/util/CertificateUtils.java @@ -104,8 +104,9 @@ public final class CertificateUtils { */ public static void writeX509CertificateChain(X509Certificate[] chain, Writer w) throws IOException { try (JcaPEMWriter jw = new JcaPEMWriter(w)) { - for (X509Certificate cert : chain) + for (X509Certificate cert : chain) { jw.writeObject(cert); + } } }