Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
Fabio Sinibaldi | b8985385ab | |
Fabio Sinibaldi | 1a37c46a77 | |
Fabio Sinibaldi | 58653d9e38 |
|
@ -2,5 +2,5 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
# Changelog for org.gcube.spatial.data.gcube-sdi-suite
|
# Changelog for org.gcube.spatial.data.gcube-sdi-suite
|
||||||
|
|
||||||
## [v1.0.0-SNAPSHOT] - 2021-2-11
|
## [v1.0.0] - 2021-2-11
|
||||||
First release
|
First release
|
||||||
|
|
|
@ -2,5 +2,5 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
# Changelog for org.gcube.spatial.data.gcube-geonetwork-client
|
# Changelog for org.gcube.spatial.data.gcube-geonetwork-client
|
||||||
|
|
||||||
## [v1.0.0-SNAPSHOT] - 2021-2-11
|
## [v1.0.0] - 2021-2-11
|
||||||
First release
|
First release
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>gcube-sdi-suite</artifactId>
|
<artifactId>gcube-sdi-suite</artifactId>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>gcube-geonetwork-client</artifactId>
|
<artifactId>gcube-geonetwork-client</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
<name>gCube GeoNetwork Client</name>
|
<name>gCube GeoNetwork Client</name>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>gcube-sdi-suite</artifactId>
|
<artifactId>gcube-sdi-suite</artifactId>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>gcube-geoserver-client</artifactId>
|
<artifactId>gcube-geoserver-client</artifactId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0-SNAPSHOT</version>
|
||||||
|
|
|
@ -2,6 +2,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
# Changelog for org.gcube.spatial.data.gcube-geoserver-connector
|
# Changelog for org.gcube.spatial.data.gcube-geoserver-connector
|
||||||
|
|
||||||
|
## [v1.0.0] - 2021-2-11
|
||||||
|
|
||||||
## [v0.2.0-SNAPSHOT] - 2021-2-11
|
## [v0.2.0-SNAPSHOT] - 2021-2-11
|
||||||
Migrated to git
|
Migrated to git
|
||||||
Embedded gcube-application-handlers.xml file
|
Embedded gcube-application-handlers.xml file
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>gcube-sdi-suite</artifactId>
|
<artifactId>gcube-sdi-suite</artifactId>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<groupId>org.gcube.data.access.geoserver</groupId>
|
<groupId>org.gcube.data.access.geoserver</groupId>
|
||||||
<artifactId>gcube-geoserver-connector</artifactId>
|
<artifactId>gcube-geoserver-connector</artifactId>
|
||||||
<version>0.2.0-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
<name>GCube GeoServer Connector</name>
|
<name>GCube GeoServer Connector</name>
|
||||||
|
|
||||||
|
|
||||||
|
|
8
pom.xml
8
pom.xml
|
@ -9,7 +9,7 @@
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<artifactId>gcube-sdi-suite</artifactId>
|
<artifactId>gcube-sdi-suite</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
<name>Gcube SDI Suite</name>
|
<name>Gcube SDI Suite</name>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
@ -90,19 +90,19 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<artifactId>gcube-geonetwork-client</artifactId>
|
<artifactId>gcube-geonetwork-client</artifactId>
|
||||||
<version>[0.0.1-SNAPSHOT,2.0.0)</version>
|
<version>[1.0.0-SNAPSHOT,2.0.0)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<artifactId>gcube-geoserver-client</artifactId>
|
<artifactId>gcube-geoserver-client</artifactId>
|
||||||
<version>[0.0.1-SNAPSHOT,2.0.0)</version>
|
<version>[1.0.0-SNAPSHOT,2.0.0)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<artifactId>sdi-test-commons</artifactId>
|
<artifactId>sdi-test-commons</artifactId>
|
||||||
<version>[0.0.1-SNAPSHOT,2.0.0)</version>
|
<version>[1.0.0-SNAPSHOT,2.0.0)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -2,5 +2,5 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
# Changelog for org.gcube.spatial.data.sdi-generic-client
|
# Changelog for org.gcube.spatial.data.sdi-generic-client
|
||||||
|
|
||||||
## [v0.0.1-SNAPSHOT] - 2021-2-11
|
## [v1.0.0] - 2021-2-11
|
||||||
First release
|
First release
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>gcube-sdi-suite</artifactId>
|
<artifactId>gcube-sdi-suite</artifactId>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>sdi-generic-client</artifactId>
|
<artifactId>sdi-generic-client</artifactId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
<name>Generic SDI Client</name>
|
<name>Generic SDI Client</name>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
# Changelog for sdi-interface
|
# Changelog for sdi-interface
|
||||||
|
|
||||||
## [v1.3.0-SNAPSHOT] - 2020-09-03
|
## [v1.3.0] - 2020-09-03
|
||||||
Added support for generic client plugin
|
Added support for generic client plugin
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>gcube-sdi-suite</artifactId>
|
<artifactId>gcube-sdi-suite</artifactId>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>sdi-interface</artifactId>
|
<artifactId>sdi-interface</artifactId>
|
||||||
<version>1.3.0-SNAPSHOT</version>
|
<version>1.3.0</version>
|
||||||
<name>SDI Interface</name>
|
<name>SDI Interface</name>
|
||||||
<description>SDI Service interface and model</description>
|
<description>SDI Service interface and model</description>
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>gcube-sdi-suite</artifactId>
|
<artifactId>gcube-sdi-suite</artifactId>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>sdi-library</artifactId>
|
<artifactId>sdi-library</artifactId>
|
||||||
<version>1.3.0-SNAPSHOT</version>
|
<version>1.3.0-SNAPSHOT</version>
|
||||||
|
|
|
@ -2,8 +2,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
# Changelog for org.gcube.spatial.data.sdi-service
|
# Changelog for org.gcube.spatial.data.sdi-service
|
||||||
|
|
||||||
## [v1.5.0-SNAPSHOT] 2020-05-15
|
## [v1.5.1-SNAPSHOT] 2021-12-14
|
||||||
|
Fixed "no protocol" on checks towards thredds instance
|
||||||
|
|
||||||
|
## [v1.5.0] 2020-05-15
|
||||||
|
removed "http" reference from code
|
||||||
|
|
||||||
## [v1.4.3-SNAPSHOT] 2020-05-15
|
## [v1.4.3-SNAPSHOT] 2020-05-15
|
||||||
changed maven repos
|
changed maven repos
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
import sys, os
|
||||||
|
|
||||||
|
project = u'PROJECT'
|
||||||
|
copyright = u'This software is part of the gCube Framework https://www.gcube-system.org/'
|
||||||
|
version = '1.0'
|
||||||
|
release = '1.0.0'
|
||||||
|
|
||||||
|
# General options
|
||||||
|
# themes https://sphinx-themes.org/
|
||||||
|
needs_sphinx = '1.0'
|
||||||
|
master_doc = 'index'
|
||||||
|
pygments_style = 'tango'
|
||||||
|
add_function_parentheses = True
|
||||||
|
|
||||||
|
extensions = ['recommonmark', 'sphinx.ext.autodoc', 'sphinxcontrib.plantuml','sphinxemoji','sphinxcontrib.redoc']
|
||||||
|
|
||||||
|
templates_path = ['_templates']
|
||||||
|
exclude_trees = ['.build']
|
||||||
|
source_encoding = 'utf-8-sig'
|
||||||
|
|
||||||
|
# HTML options
|
||||||
|
html_theme = 'sphinx_rtd_theme'
|
||||||
|
html_short_title = "project short title"
|
||||||
|
htmlhelp_basename = 'project base name'
|
||||||
|
html_use_index = True
|
||||||
|
html_show_sourcelink = True
|
||||||
|
html_static_path = ['_static']
|
||||||
|
|
||||||
|
# PlantUML options
|
||||||
|
plantuml = os.getenv('plantuml')
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<enunciate
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:noNamespaceSchemaLocation="http://enunciate.webcohesion.com/schemas/enunciate-2.14.0.xsd">
|
||||||
|
<api-classes>
|
||||||
|
<!-- Use patterns to exclude classes...
|
||||||
|
|
||||||
|
e.g. for URI-Resolver
|
||||||
|
|
||||||
|
-->
|
||||||
|
<exclude pattern="org.gcube.spatial.data.sdi.rest.DocsGenerator" />
|
||||||
|
</api-classes>
|
||||||
|
<modules>
|
||||||
|
<gwt-json-overlay disabled="true" />
|
||||||
|
<php-json-client disabled="true" />
|
||||||
|
<ruby-json-client disabled="true" />
|
||||||
|
<java-json-client disabled="true" />
|
||||||
|
<javascript-client disabled="true" />
|
||||||
|
<docs docsDir="${project.build.directory}" docsSubdir="docs" />
|
||||||
|
<!-- REPLACE THE ${project.artifactId} WITH YOUR APPLICATION NAME. E.g. /gcat, /uri-resolver. if the ${project.artifactId} is not matching your APPLICATION Name /> -->
|
||||||
|
<swagger basePath="/${project.artifactId}" />
|
||||||
|
<docs freemarkerTemplate="${project.basedir}/src/main/resources/META-INF/enunciate/d4science_docs.fmt">
|
||||||
|
<additional-css file="css/d4science_enunciate_custom.css" />
|
||||||
|
</docs>
|
||||||
|
</modules>
|
||||||
|
</enunciate>
|
|
@ -0,0 +1,8 @@
|
||||||
|
Contents of this guide :
|
||||||
|
************************
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
README.md
|
||||||
|
*
|
|
@ -3,10 +3,10 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>gcube-sdi-suite</artifactId>
|
<artifactId>gcube-sdi-suite</artifactId>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>sdi-service</artifactId>
|
<artifactId>sdi-service</artifactId>
|
||||||
<version>1.5.0-SNAPSHOT</version>
|
<version>1.5.1-SNAPSHOT</version>
|
||||||
<name>SDI Service</name>
|
<name>SDI Service</name>
|
||||||
<description>REST Interface towards SDI facilities</description>
|
<description>REST Interface towards SDI facilities</description>
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
@ -15,6 +15,13 @@
|
||||||
<developerConnection>scm:git:${gitBaseUrl}/gcube-sdi-suite</developerConnection>
|
<developerConnection>scm:git:${gitBaseUrl}/gcube-sdi-suite</developerConnection>
|
||||||
<url>${gitBaseUrl}/gcube-sdi-suite</url>
|
<url>${gitBaseUrl}/gcube-sdi-suite</url>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<enunciate.version>2.14.0</enunciate.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -194,4 +201,82 @@
|
||||||
<url>https://nexus.d4science.org/nexus/content/repositories/geotoolkit/</url>
|
<url>https://nexus.d4science.org/nexus/content/repositories/geotoolkit/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<!-- Enunciate Maven plugin -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.webcohesion.enunciate</groupId>
|
||||||
|
<artifactId>enunciate-maven-plugin</artifactId>
|
||||||
|
<version>${enunciate.version}</version>
|
||||||
|
<configuration>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>assemble</id>
|
||||||
|
<goals>
|
||||||
|
<goal>assemble</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- SPHINX PLUGIN triggered at 'compile'-->
|
||||||
|
|
||||||
|
<plugin>
|
||||||
|
<groupId>kr.motd.maven</groupId>
|
||||||
|
<artifactId>sphinx-maven-plugin</artifactId>
|
||||||
|
<version>2.10.0</version>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${project.build.directory}/wiki</outputDirectory>
|
||||||
|
<builder>html</builder>
|
||||||
|
<configDirectory>${basedir}</configDirectory>
|
||||||
|
<sourceDirectory>${basedir}</sourceDirectory>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>process-resources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>generate</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Copy Enunciate Documentation from your-application/docs to your-application.war -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>2.5</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-enunciate-docs</id>
|
||||||
|
<phase>process-resources</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>target</outputDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<targetPath>${project.build.directory}/${project.artifactId}-${project.version}/docs</targetPath>
|
||||||
|
<directory>${project.build.directory}/docs</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<targetPath>${project.build.directory}/${project.artifactId}-${project.version}/docs/wiki</targetPath>
|
||||||
|
<directory>${project.build.directory}/wiki</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
</project>
|
</project>
|
|
@ -20,10 +20,7 @@ import org.gcube.spatial.data.sdi.engine.impl.factories.SDIManagerFactory;
|
||||||
import org.gcube.spatial.data.sdi.engine.impl.factories.TemporaryPersistenceFactory;
|
import org.gcube.spatial.data.sdi.engine.impl.factories.TemporaryPersistenceFactory;
|
||||||
import org.gcube.spatial.data.sdi.engine.impl.factories.ThreddsManagerFactory;
|
import org.gcube.spatial.data.sdi.engine.impl.factories.ThreddsManagerFactory;
|
||||||
import org.gcube.spatial.data.sdi.model.ServiceConstants;
|
import org.gcube.spatial.data.sdi.model.ServiceConstants;
|
||||||
import org.gcube.spatial.data.sdi.rest.GeoNetwork;
|
import org.gcube.spatial.data.sdi.rest.*;
|
||||||
import org.gcube.spatial.data.sdi.rest.GeoServer;
|
|
||||||
import org.gcube.spatial.data.sdi.rest.SDI;
|
|
||||||
import org.gcube.spatial.data.sdi.rest.Thredds;
|
|
||||||
import org.glassfish.hk2.utilities.binding.AbstractBinder;
|
import org.glassfish.hk2.utilities.binding.AbstractBinder;
|
||||||
import org.glassfish.jersey.media.multipart.MultiPartFeature;
|
import org.glassfish.jersey.media.multipart.MultiPartFeature;
|
||||||
import org.glassfish.jersey.server.ResourceConfig;
|
import org.glassfish.jersey.server.ResourceConfig;
|
||||||
|
@ -86,7 +83,10 @@ public class SDIService extends ResourceConfig{
|
||||||
registerClasses(GeoServer.class);
|
registerClasses(GeoServer.class);
|
||||||
registerClasses(Thredds.class);
|
registerClasses(Thredds.class);
|
||||||
registerClasses(Metadata.class);
|
registerClasses(Metadata.class);
|
||||||
|
registerClasses(DocsGenerator.class);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
log.info("Initialization complete");
|
log.info("Initialization complete");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ public class ThreddsRetriever extends AbstractISModule {
|
||||||
String hostname=se.profile().runtime().hostedOn();
|
String hostname=se.profile().runtime().hostedOn();
|
||||||
try {
|
try {
|
||||||
log.trace("Checking thredds hosted on {} ",hostname);
|
log.trace("Checking thredds hosted on {} ",hostname);
|
||||||
String publicCatalogUrl="www."+hostname+"/thredds/catalog/public/netcdf/catalog.html";
|
String publicCatalogUrl="https://"+hostname+"/thredds/catalog/public/netcdf/catalog.html";
|
||||||
if(!NetUtils.isUp(publicCatalogUrl))
|
if(!NetUtils.isUp(publicCatalogUrl))
|
||||||
toReturn.add(new Status("Unreachable default THREDDS catalog at "+publicCatalogUrl,Level.ERROR));
|
toReturn.add(new Status("Unreachable default THREDDS catalog at "+publicCatalogUrl,Level.ERROR));
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -0,0 +1,43 @@
|
||||||
|
package org.gcube.spatial.data.sdi.rest;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.ws.rs.GET;
|
||||||
|
import javax.ws.rs.Path;
|
||||||
|
import javax.ws.rs.WebApplicationException;
|
||||||
|
import javax.ws.rs.core.Context;
|
||||||
|
import javax.ws.rs.core.Response;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
@Path("docs")
|
||||||
|
@Slf4j
|
||||||
|
public class DocsGenerator {
|
||||||
|
|
||||||
|
@GET
|
||||||
|
@Path("/{any: .*}")
|
||||||
|
public InputStream toDoc(@Context HttpServletRequest req) throws WebApplicationException {
|
||||||
|
log.info(DocsGenerator.class.getSimpleName() + " toDoc called");
|
||||||
|
|
||||||
|
String pathInfo = req.getPathInfo();
|
||||||
|
log.debug("pathInfo {}", pathInfo);
|
||||||
|
try {
|
||||||
|
|
||||||
|
if (pathInfo.endsWith("/docs/")) {
|
||||||
|
pathInfo += "index.html";
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("going to {}", pathInfo);
|
||||||
|
|
||||||
|
String realPath = req.getServletContext().getRealPath(pathInfo);
|
||||||
|
return new FileInputStream(new File(realPath));
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
//MANAGE THE EXCEPTION
|
||||||
|
log.error("Unexpected exception ",e);
|
||||||
|
throw new WebApplicationException("Unexpected Exception : "+e.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -4,5 +4,6 @@
|
||||||
<version>1.1.0-SNAPSHOT</version>
|
<version>1.1.0-SNAPSHOT</version>
|
||||||
<description>REST Interface towards SDI facilities</description>
|
<description>REST Interface towards SDI facilities</description>
|
||||||
<local-persistence location='target' />
|
<local-persistence location='target' />
|
||||||
|
<exclude>/gcube/service/docs/*</exclude>
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
|
|
|
@ -2,5 +2,5 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
||||||
|
|
||||||
# Changelog for org.gcube.spatial.data.sdi-test-commons
|
# Changelog for org.gcube.spatial.data.sdi-test-commons
|
||||||
|
|
||||||
## [v0.0.2-SNAPSHOT] - 2021-2-11
|
## [v1.0.0] - 2021-2-11
|
||||||
First release
|
First release
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>gcube-sdi-suite</artifactId>
|
<artifactId>gcube-sdi-suite</artifactId>
|
||||||
<groupId>org.gcube.spatial.data</groupId>
|
<groupId>org.gcube.spatial.data</groupId>
|
||||||
<version>1.0.0-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>sdi-test-commons</artifactId>
|
<artifactId>sdi-test-commons</artifactId>
|
||||||
<version>0.0.2-SNAPSHOT</version>
|
<version>1.0.0</version>
|
||||||
<name>SDI test commons</name>
|
<name>SDI test commons</name>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue