Skip to content

Commit 381fa8b

Browse files
mmercejavinp
authored andcommitted
Changing query string separator
1 parent be46cdf commit 381fa8b

File tree

66 files changed

+998
-968
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+998
-968
lines changed

Changes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changes in the BigML.io Java bindings
22

3+
## 2.1.0 version
4+
5+
* Change query string separator
36

47
## 2.0.7 version
58

@@ -18,6 +21,7 @@
1821
* Updated commons-text dependency to 1.10.0
1922
* Updated spring-core dependency to 5.3.26
2023

24+
2125
## 2.0.4 version
2226

2327
* Updated org.bigml:mimir dependency to version 0.8.3
@@ -27,6 +31,7 @@
2731

2832
* Bump jackson-databind from 2.13.2.1 to 2.13.4.1 due to security vulnerability
2933

34+
3035
## 2.0.2 version
3136

3237
* Bump spring-core, spring-test and spring-context from 5.3.19 to 5.3.20

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>org.bigml</groupId>
55
<artifactId>bigml-binding</artifactId>
6-
<version>2.0.7</version>
6+
<version>2.1.0</version>
77
<packaging>jar</packaging>
88

99
<name>BigML.io Java bindings</name>

src/main/java/org/bigml/binding/BigMLClient.java

Lines changed: 566 additions & 566 deletions
Large diffs are not rendered by default.

src/main/java/org/bigml/binding/resources/AbstractModelResource.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ public abstract class AbstractModelResource extends AbstractResource {
1919

2020
// Logging
2121
Logger logger = LoggerFactory.getLogger(AbstractModelResource.class);
22-
23-
22+
23+
2424
/**
2525
* Creates a new resource.
2626
*
27-
* POST /andromeda/xxxxx?username=$BIGML_USERNAME;api_key=$BIGML_API_KEY;
27+
* POST /andromeda/xxxxx?username=$BIGML_USERNAME&api_key=$BIGML_API_KEY;
2828
* HTTP/1.1 Host: bigml.io Content-Type: application/json
2929
*
3030
* @param datasetId
@@ -48,12 +48,12 @@ public JSONObject create(final String datasetId, JSONObject args,
4848
waitTime, retries, null);
4949
return createResource(this.resourceUrl, requestObject.toJSONString());
5050
}
51-
51+
5252

5353
/**
5454
* Creates a resource from a list of `datasets`.
5555
*
56-
* POST /andromeda/xxxxx?username=$BIGML_USERNAME;api_key=$BIGML_API_KEY;
56+
* POST /andromeda/xxxxx?username=$BIGML_USERNAME&api_key=$BIGML_API_KEY;
5757
* HTTP/1.1 Host: bigml.io Content-Type: application/json
5858
*
5959
* @param datasetsIds
@@ -75,12 +75,12 @@ public JSONObject create(final List datasetsIds, JSONObject args,
7575

7676
JSONObject requestObject = createFromDatasets(
7777
(String[]) datasetsIds.toArray(new String[datasetsIds.size()]), args, waitTime, retries, null);
78-
78+
7979
return createResource(this.resourceUrl, requestObject.toJSONString());
8080
}
81-
82-
83-
81+
82+
83+
8484
// ################################################################
8585
// #
8686
// # Protected methods
@@ -90,7 +90,7 @@ public JSONObject create(final List datasetsIds, JSONObject args,
9090
/**
9191
* Builds args dictionary for the create call from a `dataset` or a list of
9292
* `datasets`
93-
*
93+
*
9494
* @param datasets
9595
* an array of datasets ids
9696
* @param args
@@ -101,8 +101,8 @@ public JSONObject create(final List datasetsIds, JSONObject args,
101101
* @param retries
102102
* number of times to try the operation. Optional
103103
* @param key
104-
* name of the resource to create
105-
*
104+
* name of the resource to create
105+
*
106106
* @return the json representation of the new resource
107107
*/
108108
protected JSONObject createFromDatasets(final String[] datasets,
@@ -125,7 +125,7 @@ protected JSONObject createFromDatasets(final String[] datasets,
125125

126126
// Checking status
127127
try {
128-
waitForResource(datasetId, "datasetIsReady",
128+
waitForResource(datasetId, "datasetIsReady",
129129
waitTime, retries);
130130
datasetsIds.add(datasetId);
131131
} catch (Throwable e) {

src/main/java/org/bigml/binding/resources/AbstractResource.java

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -267,16 +267,16 @@ protected void init(BigMLClient bigmlClient,
267267
.getProperty("BIGML_USERNAME");
268268
this.bigmlApiKey = apiKey != null ? apiKey : System
269269
.getProperty("BIGML_API_KEY");
270-
bigmlAuth = "?username=" + this.bigmlUser + ";api_key="
271-
+ this.bigmlApiKey + ";";
270+
bigmlAuth = "?username=" + this.bigmlUser + "&api_key="
271+
+ this.bigmlApiKey + "&";
272272

273273
if (project != null) {
274274
this.project = project;
275-
bigmlAuth += "project=" + this.project + ";";
275+
bigmlAuth += "project=" + this.project + "&";
276276
}
277277
if (organization != null) {
278278
this.organization = organization;
279-
bigmlAuth += "organization=" + this.organization + ";";
279+
bigmlAuth += "organization=" + this.organization + "&";
280280
}
281281

282282
BIGML_URL = this.bigmlClient.getBigMLUrl();
@@ -301,12 +301,12 @@ public boolean isInstance(JSONObject resource) {
301301

302302
/**
303303
* Create a new resource.
304-
*
304+
*
305305
* @param urlString
306306
* the url for the remote resource
307307
* @param json
308308
* the body json for the new resource
309-
*
309+
*
310310
* @return a JSONObject for the new resource
311311
*/
312312
public JSONObject createResource(final String urlString, final String json) {
@@ -365,10 +365,10 @@ public JSONObject createResource(final String urlString, final String json) {
365365

366366
/**
367367
* Retrieve a resource.
368-
*
368+
*
369369
* @param urlString
370370
* the url for the remote resource
371-
*
371+
*
372372
* @return a JSONObject for the resource
373373
*/
374374
public JSONObject getResource(final String urlString) {
@@ -377,12 +377,12 @@ public JSONObject getResource(final String urlString) {
377377

378378
/**
379379
* Retrieve a resource.
380-
*
380+
*
381381
* @param urlString
382382
* the url for the remote resource
383383
* @param queryString
384384
* query for filtering.
385-
*
385+
*
386386
* @return a JSONObject for the resource
387387
*/
388388
public JSONObject getResource(final String urlString,
@@ -392,7 +392,7 @@ public JSONObject getResource(final String urlString,
392392

393393
/**
394394
* Retrieve a resource.
395-
*
395+
*
396396
* @param urlString
397397
* the url for the remote resource
398398
* @param queryString
@@ -401,7 +401,7 @@ public JSONObject getResource(final String urlString,
401401
* API user
402402
* @param apiKey
403403
* API key
404-
*
404+
*
405405
* @return a JSONObject for the resource
406406
*/
407407
public JSONObject getResource(final String urlString,
@@ -436,7 +436,7 @@ public JSONObject getResource(final String urlString,
436436
try {
437437
String query = queryString != null ? queryString : "";
438438
String auth = apiUser != null && apiKey != null ? "?username="
439-
+ apiUser + ";api_key=" + apiKey + ";" : bigmlAuth;
439+
+ apiUser + "&api_key=" + apiKey + "&" : bigmlAuth;
440440

441441
HttpURLConnection connection = Utils.processGET(urlString + auth + query);
442442

@@ -478,12 +478,12 @@ public JSONObject getResource(final String urlString,
478478

479479
/**
480480
* List resources.
481-
*
481+
*
482482
* @param urlString
483483
* the url for the remote resource type
484484
* @param queryString
485485
* query for filtering.
486-
*
486+
*
487487
* @return a JSONObject containing all resources matching the query
488488
*/
489489
public JSONObject listResources(final String urlString,
@@ -535,7 +535,7 @@ public JSONObject listResources(final String urlString,
535535

536536
/**
537537
* Update a resource.
538-
*
538+
*
539539
* @param urlString
540540
* the url for the remote resource
541541
* @param json
@@ -594,10 +594,10 @@ public JSONObject updateResource(final String urlString, final String json) {
594594

595595
/**
596596
* Delete a resource.
597-
*
597+
*
598598
* @param urlString
599599
* the url for the remote resource
600-
*
600+
*
601601
* @return a JSONObject for the deleted resource
602602
*/
603603
public JSONObject deleteResource(final String urlString) {
@@ -644,7 +644,7 @@ public JSONObject deleteResource(final String urlString) {
644644

645645
/**
646646
* Return a dictionary of fields
647-
*
647+
*
648648
* @param resourceId
649649
* a unique identifier in the form xxxxx/id where id is a string
650650
* of 24 alpha-numeric chars.
@@ -682,7 +682,7 @@ public JSONObject getFields(final String resourceId) {
682682

683683
/**
684684
* Maps status code to string.
685-
*
685+
*
686686
* @param resourceId
687687
* a unique identifier in the form xxxxx/id where id is a string
688688
* of 24 alpha-numeric chars.
@@ -882,7 +882,7 @@ public JSONObject list(final String queryString) {
882882
* of 24 alpha-numeric chars.
883883
* @param changes
884884
* set of parameters to update the resource. Optional
885-
*
885+
*
886886
* @return a JSONObject for the updated resource
887887
*/
888888
public JSONObject update(final String resourceId, final String changes) {
@@ -943,7 +943,7 @@ public JSONObject delete(final String resourceId) {
943943
* HTTP/1.1
944944
*
945945
* @param resource a resource JSONObject
946-
*
946+
*
947947
* @return a JSONObject for the deleted resource
948948
*/
949949
public JSONObject delete(final JSONObject resource) {
@@ -964,12 +964,12 @@ public JSONObject delete(final JSONObject resource) {
964964
* Retrieves a remote file.
965965
*
966966
* Uses HTTP GET to download a file object with a BigML `url`.
967-
*
967+
*
968968
* @param url
969969
* the url of the remote file
970970
* @param fileName
971971
* the name of the downloaded file
972-
*
972+
*
973973
* @return the json representation of the downloaded resource
974974
*/
975975
protected JSONObject download(final String url, final String fileName) {
@@ -1027,7 +1027,7 @@ protected JSONObject download(final String url, final String fileName) {
10271027
* the url of the remote file
10281028
* @param fileName
10291029
* the name of the downloaded file
1030-
*
1030+
*
10311031
* @return the json representation of the downloaded resource
10321032
*/
10331033
protected JSONObject downloadAsync(final String url, final String fileName) {
@@ -1042,7 +1042,7 @@ protected JSONObject downloadAsync(final String url, final String fileName) {
10421042
* @param url
10431043
* the url of the remote file
10441044
* @param fileName
1045-
* the name of the downloaded file
1045+
* the name of the downloaded file
10461046
* @param waitTime
10471047
* time (milliseconds) to wait for next check of FINISHED status
10481048
* for resource before to start to operation. Optional
@@ -1148,7 +1148,7 @@ protected JSONObject downloadAsync(final String url, final String fileName,
11481148

11491149
/**
11501150
* Waits for the resource to be finished
1151-
*
1151+
*
11521152
* @param resourceId
11531153
* the id of the resource to wait for
11541154
* @param isReadyMethod

src/main/java/org/bigml/binding/resources/Anomaly.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ public class Anomaly extends AbstractModelResource {
1919

2020
// Logging
2121
Logger logger = LoggerFactory.getLogger(Anomaly.class);
22-
22+
2323
/**
2424
* Constructor
25-
*
25+
*
2626
* @param bigmlClient the client with connection to BigML
2727
* @param apiUser API user
2828
* @param apiKey API key
@@ -31,18 +31,18 @@ public class Anomaly extends AbstractModelResource {
3131
* @param cacheManager cache manager
3232
*/
3333
public Anomaly(final BigMLClient bigmlClient,
34-
final String apiUser, final String apiKey,
34+
final String apiUser, final String apiKey,
3535
final String project, final String organization,
3636
final CacheManager cacheManager) {
37-
super.init(bigmlClient, apiUser, apiKey, project, organization,
37+
super.init(bigmlClient, apiUser, apiKey, project, organization,
3838
cacheManager, ANOMALY_RE, ANOMALY_PATH);
3939
}
4040

4141

4242
/**
4343
* Retrieves an anomaly.
4444
*
45-
* GET /andromeda/anomaly/id?username=$BIGML_USERNAME;api_key=$BIGML_API_KEY;
45+
* GET /andromeda/anomaly/id?username=$BIGML_USERNAME&api_key$BIGML_API_KEY&
4646
* Host: bigml.io
4747
*
4848
* @param anomalyId
@@ -69,7 +69,7 @@ public JSONObject get(final String anomalyId, final String apiUser,
6969
/**
7070
* Retrieves an anomaly.
7171
*
72-
* GET /andromeda/anomaly/id?username=$BIGML_USERNAME;api_key=$BIGML_API_KEY;
72+
* GET /andromeda/anomaly/id?username=$BIGML_USERNAME&api_key$BIGML_API_KEY&
7373
* Host: bigml.io
7474
*
7575
* @param anomaly
@@ -90,7 +90,7 @@ public JSONObject get(final JSONObject anomaly, final String apiUser,
9090
/**
9191
* Retrieves an anomaly.
9292
*
93-
* GET /andromeda/anomaly/id?username=$BIGML_USERNAME;api_key=$BIGML_API_KEY;
93+
* GET /andromeda/anomaly/id?username=$BIGML_USERNAME&api_key$BIGML_API_KEY&
9494
* Host: bigml.io
9595
*
9696
* @param anomalyId
@@ -119,7 +119,7 @@ public JSONObject get(final String anomalyId, final String queryString,
119119
/**
120120
* Retrieves an anomaly.
121121
*
122-
* GET /andromeda/anomaly/id?username=$BIGML_USERNAME;api_key=$BIGML_API_KEY;
122+
* GET /andromeda/anomaly/id?username=$BIGML_USERNAME&api_key$BIGML_API_KEY&
123123
* Host: bigml.io
124124
*
125125
* @param anomaly

0 commit comments

Comments
 (0)