commit 8d963df80852a8938e8e84b17da773285557eded from: Omar Polo date: Wed Oct 13 08:03:57 2021 UTC add constructor commit - 99b2ef4a07275a0dd3e6fcc15bfc681d3be53b8a commit + 8d963df80852a8938e8e84b17da773285557eded blob - 927d6ec28e9215b8404f4807c36e635eb3d570ea blob + 460e69e2a77a520dc77f68251dd6a9ec1ae2b890 --- java/com/omarpolo/gemini/Response.java +++ java/com/omarpolo/gemini/Response.java @@ -2,6 +2,7 @@ package com.omarpolo.gemini; import javax.net.ssl.*; import java.io.*; +import java.net.MalformedURLException; import java.net.Socket; import java.net.URL; import java.security.KeyManagementException; @@ -55,6 +56,10 @@ public class Response implements AutoCloseable { public static class MalformedResponse extends Exception {} + public Response(String url) throws IOException, MalformedResponse { + this(new URL(url)); + } + public Response(URL url) throws IOException, MalformedResponse { this(url.getHost(), url.getPort(), url.toString() + "\r\n"); }