summaryrefslogtreecommitdiff
path: root/bkucommon/src/main/java
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2015-01-12 18:59:30 +0100
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2015-02-04 03:49:11 +0100
commit27ed0a72faaa85ba456a24c8292735bbe2fa82ab (patch)
tree0368d8206375b8eea3a2f6ed21aeb9ce8f98b7fb /bkucommon/src/main/java
parentdd2338aac4651c1bfea45c6b725d923fda903d04 (diff)
downloadmocca-27ed0a72faaa85ba456a24c8292735bbe2fa82ab.tar.gz
mocca-27ed0a72faaa85ba456a24c8292735bbe2fa82ab.tar.bz2
mocca-27ed0a72faaa85ba456a24c8292735bbe2fa82ab.zip
JarLocation fix
Diffstat (limited to 'bkucommon/src/main/java')
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java2
-rw-r--r--bkucommon/src/main/java/at/gv/egiz/bku/spring/ConfigurationFactoryBean.java9
2 files changed, 5 insertions, 6 deletions
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java b/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java
index fcaa1be6..98218e52 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/binding/HTTPBindingProcessorImpl.java
@@ -143,7 +143,7 @@ public class HTTPBindingProcessorImpl extends AbstractBindingProcessor implement
String signatureLayout = configuration
.getString(ConfigurationFactoryBean.SIGNATURE_LAYOUT_PROPERTY);
- if (getUseXAdES14() && signatureLayout.equals("1.0"))
+ if (getUseXAdES14() && "1.0".equals(signatureLayout))
signatureLayout = "1.1"; //bump SignatureLayout version to prevent PDF-AS from generating invalid signatures
return signatureLayout;
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/spring/ConfigurationFactoryBean.java b/bkucommon/src/main/java/at/gv/egiz/bku/spring/ConfigurationFactoryBean.java
index ce318876..47e1320a 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/spring/ConfigurationFactoryBean.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/spring/ConfigurationFactoryBean.java
@@ -46,6 +46,7 @@ import org.springframework.core.io.ResourceLoader;
import at.gv.egiz.bku.conf.MoccaConfigurationException;
import at.gv.egiz.bku.slcommands.impl.CreateXMLSignatureCommandImpl;
+import at.gv.egiz.bku.utils.JarLocation;
/**
* This is a {@link FactoryBean} for the creation of a {@link Configuration}.
@@ -140,10 +141,10 @@ public class ConfigurationFactoryBean implements FactoryBean, ResourceLoaderAwar
// signature layout
try {
- String classContainer = CreateXMLSignatureCommandImpl.class.getProtectionDomain()
- .getCodeSource().getLocation().toString();
+ String classContainer = JarLocation.get(CreateXMLSignatureCommandImpl.class);
URL manifestUrl = new URL("jar:" + classContainer
+ "!/META-INF/MANIFEST.MF");
+ log.debug(manifestUrl.toString());
Manifest manifest = new Manifest(manifestUrl.openStream());
Attributes attributes = manifest.getMainAttributes();
String signatureLayout = attributes.getValue("SignatureLayout");
@@ -153,10 +154,8 @@ public class ConfigurationFactoryBean implements FactoryBean, ResourceLoaderAwar
} catch (Exception e) {
log.warn("Failed to get signature layout from manifest.", e);
}
-
-
+
return new MapConfiguration(map);
-
}
@Override