/** * Get the URL for the given ACME resource. * * @param resource the ACME resource (must not be {@code null}) * @param staging whether or not the ACME staging server should be used * @return the URL for the given ACME resource */ public URL getResourceUrl(AcmeResource resource, boolean staging) { Assert.checkNotNullParam("resource", resource); return getResourceUrls(staging).get(resource); }
/** * Get the resource URLs needed to perform operations from the ACME server. * * @param account the ACME account information to use (must not be {@code null}) * @param staging whether or not the staging server URL should be used * @return a map of ACME resources to URLs * @throws AcmeException if an error occurs while attempting to get the resource URLs from the ACME server */ public Map<AcmeResource, URL> getResourceUrls(AcmeAccount account, boolean staging) throws AcmeException { Assert.checkNotNullParam("account", account); final Map<AcmeResource, URL> resourceUrls = account.getResourceUrls(staging); if (resourceUrls.isEmpty()) { HttpURLConnection connection = sendGetRequest(account.getServerUrl(staging), HttpURLConnection.HTTP_OK, JSON_CONTENT_TYPE); JsonObject directoryJson = getJsonResponse(connection); try { for (AcmeResource resource : AcmeResource.values()) { String resourceUrl = getOptionalJsonString(directoryJson, resource.getValue()); URL url = resourceUrl != null ? new URL(resourceUrl) : null; resourceUrls.put(resource, url); } } catch (MalformedURLException e) { throw acme.unableToRetrieveAcmeServerDirectoryUrls(e); } } return resourceUrls; }
/** * Get the URL for the given ACME resource. * * @param resource the ACME resource (must not be {@code null}) * @param staging whether or not the ACME staging server should be used * @return the URL for the given ACME resource */ public URL getResourceUrl(AcmeResource resource, boolean staging) { Assert.checkNotNullParam("resource", resource); return getResourceUrls(staging).get(resource); }
/** * Get the URL for the given ACME resource. * * @param resource the ACME resource (must not be {@code null}) * @param staging whether or not the ACME staging server should be used * @return the URL for the given ACME resource */ public URL getResourceUrl(AcmeResource resource, boolean staging) { Assert.checkNotNullParam("resource", resource); return getResourceUrls(staging).get(resource); }
/** * Get the URL for the given ACME resource. * * @param resource the ACME resource (must not be {@code null}) * @param staging whether or not the ACME staging server should be used * @return the URL for the given ACME resource */ public URL getResourceUrl(AcmeResource resource, boolean staging) { Assert.checkNotNullParam("resource", resource); return getResourceUrls(staging).get(resource); }
/** * Get the resource URLs needed to perform operations from the ACME server. * * @param account the ACME account information to use (must not be {@code null}) * @param staging whether or not the staging server URL should be used * @return a map of ACME resources to URLs * @throws AcmeException if an error occurs while attempting to get the resource URLs from the ACME server */ public Map<AcmeResource, URL> getResourceUrls(AcmeAccount account, boolean staging) throws AcmeException { Assert.checkNotNullParam("account", account); final Map<AcmeResource, URL> resourceUrls = account.getResourceUrls(staging); if (resourceUrls.isEmpty()) { HttpURLConnection connection = sendGetRequest(account.getServerUrl(staging), HttpURLConnection.HTTP_OK, JSON_CONTENT_TYPE); JsonObject directoryJson = getJsonResponse(connection); try { for (AcmeResource resource : AcmeResource.values()) { String resourceUrl = getOptionalJsonString(directoryJson, resource.getValue()); URL url = resourceUrl != null ? new URL(resourceUrl) : null; resourceUrls.put(resource, url); } } catch (MalformedURLException e) { throw acme.unableToRetrieveAcmeServerDirectoryUrls(e); } } return resourceUrls; }
/** * Get the resource URLs needed to perform operations from the ACME server. * * @param account the ACME account information to use (must not be {@code null}) * @param staging whether or not the staging server URL should be used * @return a map of ACME resources to URLs * @throws AcmeException if an error occurs while attempting to get the resource URLs from the ACME server */ public Map<AcmeResource, URL> getResourceUrls(AcmeAccount account, boolean staging) throws AcmeException { Assert.checkNotNullParam("account", account); final Map<AcmeResource, URL> resourceUrls = account.getResourceUrls(staging); if (resourceUrls.isEmpty()) { HttpURLConnection connection = sendGetRequest(account.getServerUrl(staging), HttpURLConnection.HTTP_OK, JSON_CONTENT_TYPE); JsonObject directoryJson = getJsonResponse(connection); try { for (AcmeResource resource : AcmeResource.values()) { String resourceUrl = getOptionalJsonString(directoryJson, resource.getValue()); URL url = resourceUrl != null ? new URL(resourceUrl) : null; resourceUrls.put(resource, url); } } catch (MalformedURLException e) { throw acme.unableToRetrieveAcmeServerDirectoryUrls(e); } } return resourceUrls; }
/** * Get the resource URLs needed to perform operations from the ACME server. * * @param account the ACME account information to use (must not be {@code null}) * @param staging whether or not the staging server URL should be used * @return a map of ACME resources to URLs * @throws AcmeException if an error occurs while attempting to get the resource URLs from the ACME server */ public Map<AcmeResource, URL> getResourceUrls(AcmeAccount account, boolean staging) throws AcmeException { Assert.checkNotNullParam("account", account); final Map<AcmeResource, URL> resourceUrls = account.getResourceUrls(staging); if (resourceUrls.isEmpty()) { HttpURLConnection connection = sendGetRequest(account.getServerUrl(staging), HttpURLConnection.HTTP_OK, JSON_CONTENT_TYPE); JsonObject directoryJson = getJsonResponse(connection); try { for (AcmeResource resource : AcmeResource.values()) { String resourceUrl = getOptionalJsonString(directoryJson, resource.getValue()); URL url = resourceUrl != null ? new URL(resourceUrl) : null; resourceUrls.put(resource, url); } } catch (MalformedURLException e) { throw acme.unableToRetrieveAcmeServerDirectoryUrls(e); } } return resourceUrls; }