Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add local.storage.dir flag #516

Merged
merged 2 commits into from
Jun 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions modMcf/src/org/aion/mcf/account/Keystore.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "/keystore";
PATH = Paths.get(KEYSTORE_PATH);
}

private static List<File> getFiles() {
File[] files = PATH.toFile().listFiles();
Expand Down