|
18 | 18 | import org.labkey.remoteapi.ApiKeyCredentialsProvider; |
19 | 19 | import org.labkey.remoteapi.BasicAuthCredentialsProvider; |
20 | 20 | import org.labkey.remoteapi.Connection; |
| 21 | +import org.labkey.remoteapi.CredentialsProvider; |
21 | 22 | import org.labkey.remoteapi.NetrcCredentialsProvider; |
22 | 23 |
|
23 | 24 | import java.io.IOException; |
|
31 | 32 | */ |
32 | 33 | public class SASConnection extends Connection |
33 | 34 | { |
| 35 | + private SASConnection(String baseUrl, CredentialsProvider credentialsProvider) |
| 36 | + { |
| 37 | + super(baseUrl, credentialsProvider); |
| 38 | + setUserAgent("LabKey SAS API"); |
| 39 | + } |
| 40 | + |
34 | 41 | @SuppressWarnings({"UnusedDeclaration"}) |
35 | 42 | // Called from SAS macros via reflective JavaObj interface |
36 | | - public SASConnection(String baseUrl, String userName, String password) throws IOException, URISyntaxException |
| 43 | + public SASConnection(String baseUrl, String userName, String password) |
37 | 44 | { |
38 | | - super(baseUrl, new BasicAuthCredentialsProvider(userName, password)); |
| 45 | + this(baseUrl, new BasicAuthCredentialsProvider(userName, password)); |
39 | 46 | } |
40 | 47 |
|
41 | 48 | @SuppressWarnings({"UnusedDeclaration"}) |
42 | 49 | // Called from SAS macros via reflective JavaObj interface |
43 | 50 | public SASConnection(String baseUrl) throws IOException, URISyntaxException |
44 | 51 | { |
45 | | - super(baseUrl, new NetrcCredentialsProvider(new URI(baseUrl))); |
| 52 | + this(baseUrl, new NetrcCredentialsProvider(new URI(baseUrl))); |
46 | 53 | } |
47 | 54 |
|
48 | 55 | @SuppressWarnings({"UnusedDeclaration"}) |
49 | 56 | // Called from SAS macros via reflective JavaObj interface |
50 | | - public SASConnection(String baseUrl, String apiKey) throws IOException, URISyntaxException |
| 57 | + public SASConnection(String baseUrl, String apiKey) |
51 | 58 | { |
52 | | - super(baseUrl, new ApiKeyCredentialsProvider(apiKey)); |
| 59 | + this(baseUrl, new ApiKeyCredentialsProvider(apiKey)); |
53 | 60 | } |
54 | 61 | } |
0 commit comments