Skip to content

Commit

Permalink
Do not expect v1 when using a custom Host URL
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisStaratzis committed Jun 7, 2024
1 parent 3a6a37d commit 40210af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/main/java/examples/Examples.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

public class Examples
{
public static void main(String[] args) {
public static void main(String[] args) throws ApiException {

// if using cloud for the first time create the client with a Login object to pass your credentials.
TileDBClient tileDBClient = new TileDBClient(
Expand All @@ -27,7 +27,8 @@ public static void main(String[] args) {
System.getenv("API_TOKEN"),
true,
true,
true));
true,
"https://api.tiledb.com"));

// If the "RememberME" option is set to true in your first login you can access TileDB-Cloud without the need
// to pass any credentials from now on. Just create the client as follows:
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/io/tiledb/cloud/TileDBLogin.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,13 @@ public TileDBLogin(String username, String password, String apiKey, boolean veri
*/
public TileDBLogin(String username, String password, String apiKey, boolean verifySSL,
boolean rememberMe, boolean overwritePrevious, String host) throws ApiException {
if (host.equals("https://api.tiledb.com/v2")){
throw new ApiException("https://api.tiledb.com/v2 is not yet supported");
}

this.password = password;
this.username = username;
this.apiKey = apiKey;
this.verifySSL = verifySSL;
this.rememberMe = rememberMe;
this.host = host;
this.host = host + "/v1";
this.overwritePrevious = overwritePrevious;
}

Expand Down

0 comments on commit 40210af

Please sign in to comment.