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
This commit is contained in:
parent
e033d9b43d
commit
e956a6221a
|
@ -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 {
|
|
@ -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
|
|
@ -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
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue