From a8690cc956924e1d83b0c45d21995ee2e10fbba2 Mon Sep 17 00:00:00 2001 From: clemenso Date: Wed, 4 Mar 2009 16:44:34 +0000 Subject: 1.1-rc3 git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@311 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../main/java/at/gv/egiz/bku/conf/Configurator.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'bkucommon/src/main/java/at/gv/egiz/bku/conf/Configurator.java') diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/conf/Configurator.java b/bkucommon/src/main/java/at/gv/egiz/bku/conf/Configurator.java index a6c70d2c..6213ffcf 100644 --- a/bkucommon/src/main/java/at/gv/egiz/bku/conf/Configurator.java +++ b/bkucommon/src/main/java/at/gv/egiz/bku/conf/Configurator.java @@ -49,6 +49,13 @@ public abstract class Configurator { private Log log = LogFactory.getLog(Configurator.class); + public final static String USERAGENT_CONFIG_P = "UserAgent"; + public static final String DATAURLCONNECTION_CONFIG_P = "DataURLConnectionImplClass"; + + public static final String USERAGENT_DEFAULT = "citizen-card-environment/1.2 MOCCA/UNKNOWN"; + public static final String USERAGENT_BASE = "citizen-card-environment/1.2 MOCCA/"; + + protected Properties properties; protected CertValidator certValidator; @@ -203,22 +210,22 @@ public abstract class Configurator { } public void configureVersion() { - if (properties.getProperty(DataUrlConnection.USERAGENT_CONFIG_P) == null) { + if (properties.getProperty(USERAGENT_CONFIG_P) == null) { Properties p = new Properties(); try { InputStream is = getManifest(); if (is != null) { p.load(getManifest()); String version = p.getProperty("Implementation-Build"); - properties.setProperty(DataUrlConnection.USERAGENT_CONFIG_P, - DataUrlConnection.USERAGENT_BASE + version); + properties.setProperty(USERAGENT_CONFIG_P, + USERAGENT_BASE + version); log.debug("Setting user agent to: " + properties - .getProperty(DataUrlConnection.USERAGENT_CONFIG_P)); + .getProperty(USERAGENT_CONFIG_P)); } else { log.warn("Cannot read manifest"); - properties.setProperty(DataUrlConnection.USERAGENT_CONFIG_P, - DataUrlConnection.USERAGENT_DEFAULT); + properties.setProperty(USERAGENT_CONFIG_P, + USERAGENT_DEFAULT); } } catch (IOException e) { log.error(e); -- cgit v1.2.3