From e956a6221a5d633faa7b0fe8f72ffca5808c5eab Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Tue, 6 Nov 2018 16:26:44 +0000 Subject: [PATCH] just a refactor removed old resources git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/data-transfer/uri-resolver@174013 82a268e6-3cf1-43bd-a215-b396298e98cf --- ...ava => ApplicationProfilePropertyReader.java} | 16 ++++++++++------ .../geoexplorerappgenericresource.properties | 11 ----------- .../gisviewerappgenericresource.properties | 11 ----------- .../listeners/UriResolverStartupListener.java | 14 +++++++------- 4 files changed, 17 insertions(+), 35 deletions(-) rename src/main/java/org/gcube/datatransfer/resolver/gis/property/{ApplicationProfileGenericResourceReader.java => ApplicationProfilePropertyReader.java} (80%) delete mode 100644 src/main/java/org/gcube/datatransfer/resolver/gis/property/geoexplorerappgenericresource.properties delete mode 100644 src/main/java/org/gcube/datatransfer/resolver/gis/property/gisviewerappgenericresource.properties diff --git a/src/main/java/org/gcube/datatransfer/resolver/gis/property/ApplicationProfileGenericResourceReader.java b/src/main/java/org/gcube/datatransfer/resolver/gis/property/ApplicationProfilePropertyReader.java similarity index 80% rename from src/main/java/org/gcube/datatransfer/resolver/gis/property/ApplicationProfileGenericResourceReader.java rename to src/main/java/org/gcube/datatransfer/resolver/gis/property/ApplicationProfilePropertyReader.java index 3080f65..f288fd4 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/gis/property/ApplicationProfileGenericResourceReader.java +++ b/src/main/java/org/gcube/datatransfer/resolver/gis/property/ApplicationProfilePropertyReader.java @@ -8,12 +8,15 @@ import org.apache.log4j.Logger; /** - * The Class ApplicationProfileGenericResourceReader. + * The Class ApplicationProfilePropertyReader. * * @author Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) - * Nov 2, 2018 + * + * Read the properties APP_ID and SECONDARY_TYPE from property file + * + * Nov 6, 2018 */ -public class ApplicationProfileGenericResourceReader { +public class ApplicationProfilePropertyReader { //protected static final String GENERIC_RESOURCE_GCUBE_APPS_PROPERTIES = "gisviewerappgenericresource.properties"; protected static final String SECONDARY_TYPE = "SECONDARY_TYPE"; @@ -22,16 +25,17 @@ public class ApplicationProfileGenericResourceReader { private String appId; private String genericResource; - private Logger logger = Logger.getLogger(ApplicationProfileGenericResourceReader.class); + private Logger logger = Logger.getLogger(ApplicationProfilePropertyReader.class); + /** - * Instantiates a new application profile generic resource reader. + * Instantiates a new application profile property reader. * * @param in the in * @throws PropertyFileNotFoundException the property file not found exception */ - public ApplicationProfileGenericResourceReader(InputStream in) throws PropertyFileNotFoundException { + public ApplicationProfilePropertyReader(InputStream in) throws PropertyFileNotFoundException { Properties prop = new Properties(); try { diff --git a/src/main/java/org/gcube/datatransfer/resolver/gis/property/geoexplorerappgenericresource.properties b/src/main/java/org/gcube/datatransfer/resolver/gis/property/geoexplorerappgenericresource.properties deleted file mode 100644 index 17552bf..0000000 --- a/src/main/java/org/gcube/datatransfer/resolver/gis/property/geoexplorerappgenericresource.properties +++ /dev/null @@ -1,11 +0,0 @@ -# Property files -# -# author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it -# created 02/2013 -# -# The generic resource that describes the properties to open -# an item from workspace -# - -SECONDARY_TYPE = ApplicationProfile -APP_ID = org.gcube.portlets.user.geoexplorer.server.GeoExplorerServiceImpl \ No newline at end of file diff --git a/src/main/java/org/gcube/datatransfer/resolver/gis/property/gisviewerappgenericresource.properties b/src/main/java/org/gcube/datatransfer/resolver/gis/property/gisviewerappgenericresource.properties deleted file mode 100644 index 4d8c067..0000000 --- a/src/main/java/org/gcube/datatransfer/resolver/gis/property/gisviewerappgenericresource.properties +++ /dev/null @@ -1,11 +0,0 @@ -# Property files -# -# author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it -# created 02/2013 -# -# The generic resource that describes the properties to open -# an item from workspace -# - -SECONDARY_TYPE = ApplicationProfile -APP_ID = org.gcube.portlets.user.gisviewerapp.server.GisViewerAppServiceImpl \ No newline at end of file diff --git a/src/main/java/org/gcube/datatransfer/resolver/listeners/UriResolverStartupListener.java b/src/main/java/org/gcube/datatransfer/resolver/listeners/UriResolverStartupListener.java index d4c9a8d..a7f49c9 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/listeners/UriResolverStartupListener.java +++ b/src/main/java/org/gcube/datatransfer/resolver/listeners/UriResolverStartupListener.java @@ -18,7 +18,7 @@ import javax.servlet.annotation.WebListener; import org.gcube.datatransfer.resolver.caches.LoadingCatalogueApplicationProfilesCache; import org.gcube.datatransfer.resolver.caches.LoadingGeonetworkInstanceCache; import org.gcube.datatransfer.resolver.caches.LoadingGisViewerApplicationURLCache; -import org.gcube.datatransfer.resolver.gis.property.ApplicationProfileGenericResourceReader; +import org.gcube.datatransfer.resolver.gis.property.ApplicationProfilePropertyReader; import org.gcube.datatransfer.resolver.gis.property.PropertyFileNotFoundException; import org.gcube.smartgears.ContextProvider; import org.gcube.smartgears.context.application.ApplicationContext; @@ -54,8 +54,8 @@ public class UriResolverStartupListener implements ServletContextListener { private static String rootContextScope = null; - private static ApplicationProfileGenericResourceReader gisViewerProfile; - private static ApplicationProfileGenericResourceReader geoExplorerProfile; + private static ApplicationProfilePropertyReader gisViewerProfile; + private static ApplicationProfilePropertyReader geoExplorerProfile; /* (non-Javadoc) * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) @@ -102,14 +102,14 @@ public class UriResolverStartupListener implements ServletContextListener { * @param propertyFileName the property file name * @return the currency */ - private static ApplicationProfileGenericResourceReader loadApplicationProfile(ServletContext context, String propertyFileName) { + private static ApplicationProfilePropertyReader loadApplicationProfile(ServletContext context, String propertyFileName) { String contextPath = "/WEB-INF/property/"+propertyFileName; String realPath = context.getRealPath(contextPath); try { Properties props = new Properties(); props.load(new FileInputStream(new File(realPath))); - return new ApplicationProfileGenericResourceReader(new FileInputStream(new File(realPath))); + return new ApplicationProfilePropertyReader(new FileInputStream(new File(realPath))); } catch (PropertyFileNotFoundException | FileNotFoundException ex) { logger.error("PropertyFileNotFoundException: "+contextPath, ex); @@ -145,7 +145,7 @@ public class UriResolverStartupListener implements ServletContextListener { * * @return the gis viewer profile */ - public static ApplicationProfileGenericResourceReader getGisViewerProfile() { + public static ApplicationProfilePropertyReader getGisViewerProfile() { return gisViewerProfile; } @@ -156,7 +156,7 @@ public class UriResolverStartupListener implements ServletContextListener { * * @return the geoExplorerProfile */ - public static ApplicationProfileGenericResourceReader getGeoExplorerProfile() { + public static ApplicationProfilePropertyReader getGeoExplorerProfile() { return geoExplorerProfile; }