fixed getAsUrl

This commit is contained in:
Francesco Mangiacrapa 2024-04-23 10:46:59 +02:00
parent be9b396967
commit f5c17150e6
1 changed files with 5 additions and 5 deletions

View File

@ -58,7 +58,7 @@ public class GeoportalExporter {
public static final String PATH_USECASE_ID = GeoportalResolver.PATH_USECASE_ID; public static final String PATH_USECASE_ID = GeoportalResolver.PATH_USECASE_ID;
public static final String PATH_VRE_NAME = GeoportalResolver.PATH_VRE_NAME; public static final String PATH_VRE_NAME = GeoportalResolver.PATH_VRE_NAME;
public static final String QUERY_PARAMETER_AS_URL = "as_url"; public static final String QUERY_PARAMETER_AS_URL = "as-url";
private static final Logger LOG = LoggerFactory.getLogger(GeoportalExporter.class); private static final Logger LOG = LoggerFactory.getLogger(GeoportalExporter.class);
private static String helpURI = "https://wiki.gcube-system.org/gcube/URI_Resolver#Geoportal_Resolver"; private static String helpURI = "https://wiki.gcube-system.org/gcube/URI_Resolver#Geoportal_Resolver";
@ -97,8 +97,8 @@ public class GeoportalExporter {
String userAgentName = req.getHeader("User-Agent"); String userAgentName = req.getHeader("User-Agent");
LOG.info(this.getClass().getSimpleName() + " export - GET starts..."); LOG.info(this.getClass().getSimpleName() + " export - GET starts...");
LOG.info("Params: [" + EXPORT_TYPE + ": {}, " + PATH_USECASE_ID + ": {}, " + PATH_PROJECT_ID + ": {}]", LOG.info("Params: [" + EXPORT_TYPE + ": {}, " + PATH_USECASE_ID + ": {}, " + PATH_PROJECT_ID + ": {}, " + QUERY_PARAMETER_AS_URL + ": {}]",
export_type, ucdID, projectID); export_type, ucdID, projectID, asURL);
checkPathParameterNotNull(req, EXPORT_TYPE, export_type); checkPathParameterNotNull(req, EXPORT_TYPE, export_type);
checkPathParameterNotNull(req, PATH_USECASE_ID, ucdID); checkPathParameterNotNull(req, PATH_USECASE_ID, ucdID);
@ -110,7 +110,7 @@ public class GeoportalExporter {
} catch (Exception e) { } catch (Exception e) {
} }
LOG.info(QUERY_PARAMETER_AS_URL + "is: {}", export_type, ucdID, getAsURL); LOG.info("getAsURL is: {}", getAsURL);
checkExportType(req, export_type); checkExportType(req, export_type);
@ -191,7 +191,7 @@ public class GeoportalExporter {
return response.build(); return response.build();
} else { } else {
// returning as URI; // returning as URI;
return Response.seeOther(pdfRef.getStorageVolatileURL().toURI()).build(); return Response.ok(pdfRef.getStorageVolatileURL().toURI()).build();
} }
} }
} catch (Exception e) { } catch (Exception e) {