Using the right query parameter

This commit is contained in:
Luca Frosini 2022-07-14 15:51:24 +02:00
parent 8a4a70673c
commit 9a856a68f8
1 changed files with 5 additions and 3 deletions

View File

@ -34,7 +34,9 @@ import org.gcube.informationsystem.resourceregistry.api.exceptions.queries.Inval
import org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException;
import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath; import org.gcube.informationsystem.resourceregistry.api.rest.AccessPath;
import org.gcube.informationsystem.resourceregistry.api.rest.InstancePath;
import org.gcube.informationsystem.resourceregistry.api.rest.QueryTemplatePath; import org.gcube.informationsystem.resourceregistry.api.rest.QueryTemplatePath;
import org.gcube.informationsystem.resourceregistry.api.rest.TypePath;
import org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPUtility; import org.gcube.informationsystem.resourceregistry.api.rest.httputils.HTTPUtility;
import org.gcube.informationsystem.resourceregistry.api.utils.Utility; import org.gcube.informationsystem.resourceregistry.api.utils.Utility;
import org.gcube.informationsystem.types.TypeMapper; import org.gcube.informationsystem.types.TypeMapper;
@ -238,7 +240,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
gxHTTPStringRequest.path(typeName); gxHTTPStringRequest.path(typeName);
Map<String,String> parameters = new HashMap<>(); Map<String,String> parameters = new HashMap<>();
parameters.put(AccessPath._POLYMORPHIC_PARAM, Boolean.FALSE.toString()); parameters.put(InstancePath.POLYMORPHIC_PARAM, Boolean.FALSE.toString());
gxHTTPStringRequest.queryParams(parameters); gxHTTPStringRequest.queryParams(parameters);
HttpURLConnection httpURLConnection = gxHTTPStringRequest.head(); HttpURLConnection httpURLConnection = gxHTTPStringRequest.head();
@ -285,7 +287,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
gxHTTPStringRequest.path(typeName); gxHTTPStringRequest.path(typeName);
Map<String,String> parameters = new HashMap<>(); Map<String,String> parameters = new HashMap<>();
parameters.put(AccessPath._POLYMORPHIC_PARAM, polymorphic.toString()); parameters.put(TypePath.POLYMORPHIC_PARAM, polymorphic.toString());
gxHTTPStringRequest.queryParams(parameters); gxHTTPStringRequest.queryParams(parameters);
HttpURLConnection httpURLConnection = gxHTTPStringRequest.get(); HttpURLConnection httpURLConnection = gxHTTPStringRequest.get();
@ -330,7 +332,7 @@ public class ResourceRegistryClientImpl implements ResourceRegistryClient {
gxHTTPStringRequest.path(type); gxHTTPStringRequest.path(type);
Map<String,String> parameters = new HashMap<>(); Map<String,String> parameters = new HashMap<>();
parameters.put(AccessPath._POLYMORPHIC_PARAM, polymorphic.toString()); parameters.put(InstancePath.POLYMORPHIC_PARAM, polymorphic.toString());
includeAdditionalQueryParameters(gxHTTPStringRequest, parameters); includeAdditionalQueryParameters(gxHTTPStringRequest, parameters);
HttpURLConnection httpURLConnection = gxHTTPStringRequest.get(); HttpURLConnection httpURLConnection = gxHTTPStringRequest.get();