Added usage of common-utility

This commit is contained in:
Luca Frosini 2023-02-22 15:16:07 +01:00
parent 00c275d22f
commit 926812df1d
3 changed files with 9 additions and 3 deletions

View File

@ -5,6 +5,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
## [v4.2.0-SNAPSHOT]
- Enhanced gcube-bom version
- Added usage of common-utility to overcome issues with different Smartgears version (i.e. 3 and 4)
## [v4.1.0]

View File

@ -49,6 +49,10 @@
<groupId>org.gcube.common</groupId>
<artifactId>gxHTTP</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>common-utility</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>

View File

@ -7,6 +7,7 @@ import java.util.Map;
import org.gcube.common.gxhttp.reference.GXConnection;
import org.gcube.common.gxhttp.request.GXHTTPStringRequest;
import org.gcube.common.http.GXHTTPUtility;
import org.gcube.informationsystem.base.reference.Element;
import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
@ -57,7 +58,7 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
logger.trace("Going to create: {}", typeDefinitition);
Type typeDefinitionObj = TypeMapper.deserializeTypeDefinition(typeDefinitition);
GXHTTPStringRequest gxHTTPStringRequest = GXHTTPStringRequest.newRequest(address);
GXHTTPStringRequest gxHTTPStringRequest = GXHTTPUtility.getGXHTTPStringRequest(address);
gxHTTPStringRequest.from(ResourceRegistrySchemaClient.class.getSimpleName());
gxHTTPStringRequest.header("Accept", GXConnection.APPLICATION_JSON_CHARSET_UTF_8);
gxHTTPStringRequest.header("Content-type", GXConnection.APPLICATION_JSON_CHARSET_UTF_8);
@ -93,7 +94,7 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
public boolean exist(String typeName) throws ResourceRegistryException {
try {
logger.info("Going to get {} schema", typeName);
GXHTTPStringRequest gxHTTPStringRequest = GXHTTPStringRequest.newRequest(address);
GXHTTPStringRequest gxHTTPStringRequest = GXHTTPUtility.getGXHTTPStringRequest(address);
gxHTTPStringRequest.from(ResourceRegistrySchemaClient.class.getSimpleName());
gxHTTPStringRequest.header("Accept", GXConnection.APPLICATION_JSON_CHARSET_UTF_8);
gxHTTPStringRequest.path(TypePath.TYPES_PATH_PART);
@ -135,7 +136,7 @@ public class ResourceRegistrySchemaClientImpl implements ResourceRegistrySchemaC
public String read(String typeName, Boolean polymorphic) throws ContextNotFoundException, ResourceRegistryException {
try {
logger.info("Going to get {} schema", typeName);
GXHTTPStringRequest gxHTTPStringRequest = GXHTTPStringRequest.newRequest(address);
GXHTTPStringRequest gxHTTPStringRequest = GXHTTPUtility.getGXHTTPStringRequest(address);
gxHTTPStringRequest.from(ResourceRegistrySchemaClient.class.getSimpleName());
gxHTTPStringRequest.header("Accept", GXConnection.APPLICATION_JSON_CHARSET_UTF_8);
gxHTTPStringRequest.path(TypePath.TYPES_PATH_PART);