Skip to content

Commit

Permalink
push candidate 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amattioc committed Apr 24, 2024
1 parent adaa19c commit 76a6e79
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 37 deletions.
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20240409-0913
20240424-0928
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public Sdmx30Queries addParams(String filter, String start, String end, String a
String endFilter = (end != null && !end.isEmpty()) ? "le:" + end : "";
String sep = (!startFilter.isEmpty() && !endFilter.isEmpty()) ? "+" : "";
String timeFilter = startFilter + sep + endFilter;
addParam("c[TIME_PERIOD]=", timeFilter);
addParam("c[TIME_PERIOD]", timeFilter);
}
if (attributes != null)
addParam("attributes", attributes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,15 @@
*/
package it.bancaditalia.oss.sdmx.util;

import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

import it.bancaditalia.oss.sdmx.parser.v21.Sdmx21Queries;

/**
* URL builder for rest queries.
*
Expand Down Expand Up @@ -99,37 +95,23 @@ public RestQueryBuilder addFilter(String filter) {
*/
public URL build() throws MalformedURLException
{
try {
StringBuilder result = new StringBuilder();
result.append(entryPoint);

if(this instanceof Sdmx21Queries){
for (String path : paths)
result.append('/').append(URLEncoder.encode(path, "UTF-8"));
}
else{
for (String path : paths)
result.append('/').append(path);
}

boolean first = true;
if(filter != null){
result.append(first ? '?' : '&');
//result.append(URLEncoder.encode(filter, "UTF-8"));
result.append(filter);
first = false;
}
for (Entry<String, String> entry: params.entrySet())
{
result.append(first ? '?' : '&');
result.append(URLEncoder.encode(entry.getKey(), "UTF-8")).append('=').append(entry.getValue());
first = false;
}

return new URL(result.toString());
} catch (UnsupportedEncodingException e) {
// safe to ignore.
throw new RuntimeException("UnsupportedEncodingException", e);
StringBuilder result = new StringBuilder();
result.append(entryPoint);
for (String path : paths)
result.append('/').append(path);
boolean first = true;
if(filter != null){
result.append(first ? '?' : '&');
result.append(filter);
first = false;
}
for (Entry<String, String> entry: params.entrySet())
{
result.append(first ? '?' : '&');
result.append(entry.getKey()).append('=').append(entry.getValue());
first = false;
}

return new URL(result.toString());
}
}
Binary file modified RJSDMX/inst/java/SDMX.jar
Binary file not shown.
Binary file modified STATA/jar/SDMX.jar
Binary file not shown.

0 comments on commit 76a6e79

Please sign in to comment.