From 831fabaf6198e7bfd1509ed9bc1fc7827c139733 Mon Sep 17 00:00:00 2001 From: tkellner Date: Mon, 9 Sep 2013 17:54:53 +0000 Subject: Allow user to set SWCard directory git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@1207 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- smcc/src/main/java/at/gv/egiz/smcc/SWCard.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'smcc/src') diff --git a/smcc/src/main/java/at/gv/egiz/smcc/SWCard.java b/smcc/src/main/java/at/gv/egiz/smcc/SWCard.java index a896c9a1..62f3e3e3 100644 --- a/smcc/src/main/java/at/gv/egiz/smcc/SWCard.java +++ b/smcc/src/main/java/at/gv/egiz/smcc/SWCard.java @@ -25,6 +25,7 @@ package at.gv.egiz.smcc; import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; @@ -97,6 +98,16 @@ public class SWCard implements SignatureCard { String userHome = System.getProperty("user.home"); String fs = System.getProperty("file.separator"); swCardDir = userHome + fs + BKU_USER_DIR + fs + SWCARD_DIR; + String swcDir = System.getProperty("mocca.swcard.directory"); + if (swcDir != null) { + File f = new File(swcDir); + if (!f.isAbsolute()) { + swcDir = userHome + fs + BKU_USER_DIR + fs + swcDir; + f = new File(swcDir); + } + if (f.isDirectory()) + swCardDir = swcDir; + } } /** -- cgit v1.2.3