From 7770c9c0ee56007728a50d13439daccacce8b476 Mon Sep 17 00:00:00 2001 From: Victor Balan Date: Mon, 4 Jun 2018 16:48:03 +0300 Subject: [PATCH 1/2] AW-103 Add local.storage.dir flag --- modMcf/src/org/aion/mcf/account/Keystore.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modMcf/src/org/aion/mcf/account/Keystore.java b/modMcf/src/org/aion/mcf/account/Keystore.java index f4b137a2fb..6ad0f6132b 100644 --- a/modMcf/src/org/aion/mcf/account/Keystore.java +++ b/modMcf/src/org/aion/mcf/account/Keystore.java @@ -64,13 +64,22 @@ public class Keystore { private static final Logger LOG = AionLoggerFactory.getLogger(LogEnum.API.name()); - private static final String KEYSTORE_PATH = System.getProperty("user.dir") + "/keystore"; - private static final Path PATH = Paths.get(KEYSTORE_PATH); private static final FileDateTimeComparator COMPARE = new FileDateTimeComparator(); private static final Pattern HEX_64 = Pattern.compile("^[\\p{XDigit}]{64}$"); private static final String ADDR_PREFIX = "0x"; private static final String AION_PREFIX = "a0"; private static final int IMPORT_LIMIT = 100; + private static final String KEYSTORE_PATH; + private static final Path PATH; + + static { + String storageDir = System.getProperty("local.storage.dir"); + if (storageDir == null || storageDir.equalsIgnoreCase("")) { + storageDir = System.getProperty("user.dir"); + } + KEYSTORE_PATH = storageDir + "/keytstore"; + PATH = Paths.get(KEYSTORE_PATH); + } private static List getFiles() { File[] files = PATH.toFile().listFiles(); From fdc1e7e05f7d401a90996401077446ab137e35f3 Mon Sep 17 00:00:00 2001 From: Victor Balan Date: Tue, 5 Jun 2018 11:18:13 +0300 Subject: [PATCH 2/2] Fix typo in ketstore path --- modMcf/src/org/aion/mcf/account/Keystore.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modMcf/src/org/aion/mcf/account/Keystore.java b/modMcf/src/org/aion/mcf/account/Keystore.java index 6ad0f6132b..3627e238fd 100644 --- a/modMcf/src/org/aion/mcf/account/Keystore.java +++ b/modMcf/src/org/aion/mcf/account/Keystore.java @@ -77,7 +77,7 @@ public class Keystore { if (storageDir == null || storageDir.equalsIgnoreCase("")) { storageDir = System.getProperty("user.dir"); } - KEYSTORE_PATH = storageDir + "/keytstore"; + KEYSTORE_PATH = storageDir + "/keystore"; PATH = Paths.get(KEYSTORE_PATH); }