Skip to content

Commit b583761

Browse files
committed
Don't modify signature of 'Connection' constructor.
1 parent f8b012a commit b583761

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

labkey-client-api/src/org/labkey/remoteapi/Connection.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,14 @@ public Connection(String baseUrl, CredentialsProvider credentialsProvider)
173173
* Constructs a new Connection object with a base URL that attempts authentication via .netrc/_netrc entry, if present.
174174
* If not present, connects as guest.
175175
* @param baseUrl The base URL
176+
* @throws URISyntaxException if the given url is not a valid URI
176177
* @throws IOException if there are problems reading the credentials
177178
* @see NetrcCredentialsProvider
178179
* @see #Connection(URI, CredentialsProvider)
179180
*/
180-
public Connection(String baseUrl) throws IOException
181+
public Connection(String baseUrl) throws URISyntaxException, IOException
181182
{
182-
this(toURI(baseUrl), new NetrcCredentialsProvider(toURI(baseUrl)));
183+
this(new URI(baseUrl), new NetrcCredentialsProvider(new URI(baseUrl)));
183184
}
184185

185186
/**
@@ -541,4 +542,4 @@ private static URI toURI(String baseUrl)
541542
throw new IllegalArgumentException("Invalid target server URL: " + baseUrl);
542543
}
543544
}
544-
}
545+
}

labkey-client-api/src/org/labkey/remoteapi/query/ImportDataCommand.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import java.io.InputStreamReader;
3333
import java.io.StringWriter;
3434
import java.net.URI;
35+
import java.net.URISyntaxException;
3536
import java.util.Arrays;
3637
import java.util.Objects;
3738
import java.util.stream.Collectors;
@@ -297,7 +298,7 @@ public ImportDataCommand copy()
297298
return new ImportDataCommand(this);
298299
}
299300

300-
public static void main(String[] args) throws IOException
301+
public static void main(String[] args) throws IOException, URISyntaxException
301302
{
302303
// required
303304
String baseServerUrl = null;

0 commit comments

Comments
 (0)