Changeset 963:bfb42acb9ba3


Ignore:
Timestamp:
04/02/13 12:37:12 (6 years ago)
Author:
Babis Nikolaou <charnik@…>
Branch:
default
Message:

made EndpointCapabilities? read the version file to get the version of Strabon

Location:
endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/capabilities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/capabilities/CapabilitiesBean.java

    r962 r963  
    147147                } 
    148148                 
     149                out.println(); 
     150                 
    149151                // print supported spatial extension functions for GeoSPARQL 
    150152                if (caps.getGeoSPARQLSpatialExtensionFunctions() != null) { 
  • endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/capabilities/EndpointCapabilities.java

    r961 r963  
    1010package eu.earthobservatory.org.StrabonEndpoint.capabilities; 
    1111 
     12import java.io.IOException; 
     13import java.io.InputStream; 
    1214import java.util.List; 
     15import java.util.Properties; 
    1316 
    1417import org.openrdf.query.algebra.evaluation.function.spatial.GeoConstants; 
     18import org.slf4j.Logger; 
     19import org.slf4j.LoggerFactory; 
    1520 
    1621 
     
    2429public class EndpointCapabilities implements Capabilities { 
    2530 
     31        private static Logger logger = LoggerFactory.getLogger(eu.earthobservatory.org.StrabonEndpoint.capabilities.EndpointCapabilities.class); 
     32         
     33        private static final String VERSION_PROPERTIES_FILE = "/version.properties"; 
     34        private static final Properties PROPERTIES = new Properties(); 
     35 
     36        private static String VERSION; 
     37         
     38        // load the properties file to get the version 
     39        static { 
     40                InputStream vin = Capabilities.class.getResourceAsStream(VERSION_PROPERTIES_FILE); 
     41                if (vin != null) { 
     42                        try { 
     43                                PROPERTIES.load(vin); 
     44                                vin.close(); 
     45                                 
     46                        } catch (IOException e) { 
     47                                logger.error("[StrabonEndpoint.EndpointCapabilities] Error during reading of {} file.", VERSION_PROPERTIES_FILE, e); 
     48                        } 
     49                } else { 
     50                        logger.warn("[StrabonEndpoint.EndpointCapabilities] Could not read version file."); 
     51                } 
     52                 
     53                VERSION = PROPERTIES.getProperty("version"); 
     54        } 
     55         
    2656        @Override 
    2757        public String getVersion() { 
    28                 return "3.2.9-SNAPSHOT"; 
     58                return VERSION; 
    2959        } 
    3060         
Note: See TracChangeset for help on using the changeset viewer.