From 3ce832d83e8647b29a888b7ebc0c23acd7ed4bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20K=C3=B6rber?= Date: Sat, 5 Aug 2017 14:41:41 +0200 Subject: [PATCH] Review URI/URL use --- .../acme4j/connector/DefaultConnection.java | 2 +- .../shredzone/acme4j/connector/HttpConnector.java | 2 +- .../org/shredzone/acme4j/provider/AcmeProvider.java | 2 +- .../letsencrypt/LetsEncryptAcmeProviderTest.java | 12 ++++++------ .../main/java/org/shredzone/acme4j/ClientTest.java | 6 +++--- src/site/markdown/ca/index.md | 2 +- src/site/markdown/provider.md | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/connector/DefaultConnection.java b/acme4j-client/src/main/java/org/shredzone/acme4j/connector/DefaultConnection.java index d33da583..ee5c2956 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/connector/DefaultConnection.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/connector/DefaultConnection.java @@ -234,7 +234,7 @@ public class DefaultConnection implements Connection { Problem problem = new Problem(readJsonResponse(), conn.getURL().toURI()); throw createAcmeException(problem); } catch (URISyntaxException ex) { - throw new AcmeProtocolException("Bad request URI: " + conn.getURL(), ex); + throw new AcmeProtocolException("Bad request URL: " + conn.getURL(), ex); } catch (IOException ex) { throw new AcmeNetworkException(ex); } diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/connector/HttpConnector.java b/acme4j-client/src/main/java/org/shredzone/acme4j/connector/HttpConnector.java index ecfe6fea..8942599c 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/connector/HttpConnector.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/connector/HttpConnector.java @@ -22,7 +22,7 @@ import java.util.Properties; import org.slf4j.LoggerFactory; /** - * A generic HTTP connector. It connects to the given URI with a 10 seconds connection and + * A generic HTTP connector. It connects to the given URL with a 10 seconds connection and * read timeout. *

* Subclasses may reconfigure the {@link HttpURLConnection} and pin it to a concrete SSL diff --git a/acme4j-client/src/main/java/org/shredzone/acme4j/provider/AcmeProvider.java b/acme4j-client/src/main/java/org/shredzone/acme4j/provider/AcmeProvider.java index 78938573..fdc7d3be 100644 --- a/acme4j-client/src/main/java/org/shredzone/acme4j/provider/AcmeProvider.java +++ b/acme4j-client/src/main/java/org/shredzone/acme4j/provider/AcmeProvider.java @@ -60,7 +60,7 @@ public interface AcmeProvider { Connection connect(); /** - * Returns the provider's directory. The structure must contain resource URIs, and may + * Returns the provider's directory. The structure must contain resource URLs, and may * optionally contain metadata. *

* The default implementation resolves the server URI and fetches the directory via diff --git a/acme4j-client/src/test/java/org/shredzone/acme4j/provider/letsencrypt/LetsEncryptAcmeProviderTest.java b/acme4j-client/src/test/java/org/shredzone/acme4j/provider/letsencrypt/LetsEncryptAcmeProviderTest.java index 63c76fab..2727c308 100644 --- a/acme4j-client/src/test/java/org/shredzone/acme4j/provider/letsencrypt/LetsEncryptAcmeProviderTest.java +++ b/acme4j-client/src/test/java/org/shredzone/acme4j/provider/letsencrypt/LetsEncryptAcmeProviderTest.java @@ -27,8 +27,8 @@ import org.junit.Test; */ public class LetsEncryptAcmeProviderTest { - private static final String V01_DIRECTORY_URI = "https://acme-v01.api.letsencrypt.org/directory"; - private static final String STAGING_DIRECTORY_URI = "https://acme-staging.api.letsencrypt.org/directory"; + private static final String V01_DIRECTORY_URL = "https://acme-v01.api.letsencrypt.org/directory"; + private static final String STAGING_DIRECTORY_URL = "https://acme-staging.api.letsencrypt.org/directory"; /** * Tests if the provider accepts the correct URIs. @@ -53,10 +53,10 @@ public class LetsEncryptAcmeProviderTest { public void testResolve() throws URISyntaxException { LetsEncryptAcmeProvider provider = new LetsEncryptAcmeProvider(); - assertThat(provider.resolve(new URI("acme://letsencrypt.org")), is(url(V01_DIRECTORY_URI))); - assertThat(provider.resolve(new URI("acme://letsencrypt.org/")), is(url(V01_DIRECTORY_URI))); - assertThat(provider.resolve(new URI("acme://letsencrypt.org/v01")), is(url(V01_DIRECTORY_URI))); - assertThat(provider.resolve(new URI("acme://letsencrypt.org/staging")), is(url(STAGING_DIRECTORY_URI))); + assertThat(provider.resolve(new URI("acme://letsencrypt.org")), is(url(V01_DIRECTORY_URL))); + assertThat(provider.resolve(new URI("acme://letsencrypt.org/")), is(url(V01_DIRECTORY_URL))); + assertThat(provider.resolve(new URI("acme://letsencrypt.org/v01")), is(url(V01_DIRECTORY_URL))); + assertThat(provider.resolve(new URI("acme://letsencrypt.org/staging")), is(url(STAGING_DIRECTORY_URL))); try { provider.resolve(new URI("acme://letsencrypt.org/v99")); diff --git a/acme4j-example/src/main/java/org/shredzone/acme4j/ClientTest.java b/acme4j-example/src/main/java/org/shredzone/acme4j/ClientTest.java index b070226f..0a9d25eb 100644 --- a/acme4j-example/src/main/java/org/shredzone/acme4j/ClientTest.java +++ b/acme4j-example/src/main/java/org/shredzone/acme4j/ClientTest.java @@ -111,7 +111,7 @@ public class ClientTest { Certificate certificate = order.getCertificate(); LOG.info("Success! The certificate for domains " + domains + " has been generated!"); - LOG.info("Certificate URI: " + certificate.getLocation()); + LOG.info("Certificate URL: " + certificate.getLocation()); // Write a combined file containing the certificate and chain. try (FileWriter fw = new FileWriter(DOMAIN_CHAIN_FILE)) { @@ -174,7 +174,7 @@ public class ClientTest { * created. *

* This is a simple way of finding your {@link Account}. A better way is to get - * the URI of your new account with {@link Account#getLocation()} and store + * the URL of your new account with {@link Account#getLocation()} and store * it somewhere. If you need to get access to your account later, reconnect to it via * {@link Account#bind(Session, URI)} by using the stored location. * @@ -190,7 +190,7 @@ public class ClientTest { } Account acct = new AccountBuilder().agreeToTermsOfService().create(session); - LOG.info("Registered a new user, URI: " + acct.getLocation()); + LOG.info("Registered a new user, URL: " + acct.getLocation()); return acct; } diff --git a/src/site/markdown/ca/index.md b/src/site/markdown/ca/index.md index 8babb3db..152e34dc 100644 --- a/src/site/markdown/ca/index.md +++ b/src/site/markdown/ca/index.md @@ -2,7 +2,7 @@ _acme4j_ should support any CA providing an ACME server. -It is always possible to connect to an ACME server by passing in the CA's resource directory URI: +It is always possible to connect to an ACME server by passing in the CA's resource directory URL: ```java Session session = diff --git a/src/site/markdown/provider.md b/src/site/markdown/provider.md index af43889c..cbb4708a 100644 --- a/src/site/markdown/provider.md +++ b/src/site/markdown/provider.md @@ -1,6 +1,6 @@ # ACME Provider -Basically, it is possible to connect to any kind of ACME server just by connecting to the URI of its directory resource: +Basically, it is possible to connect to any kind of ACME server just by connecting to the URL of its directory resource: ```java Session session = new Session("https://acme-v02.api.letsencrypt.org/directory", accountKeyPair); @@ -43,4 +43,4 @@ In your `AcmeProvider` implementation, override the `createChallenge(Session, St ## No directory service -To modify the directory of an ACME server, or use a static directory, override the `directory(Session, URI)` method, and return a `JSON` of all available resources and their respective URI. +To modify the directory of an ACME server, or use a static directory, override the `directory(Session, URI)` method, and return a `JSON` of all available resources and their respective URL.