Skip to content

Commit

Permalink
(fix) windows path (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengjiachun authored and killme2008 committed Mar 19, 2019
1 parent 8c10931 commit 9e19b08
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public boolean start(Endpoint listenAddr, boolean emptyPeers, int snapshotInterv
nodeOptions.setEnableMetrics(enableMetrics);
nodeOptions.setSnapshotThrottle(snapshotThrottle);
nodeOptions.setSnapshotIntervalSecs(snapshotIntervalSecs);
final String serverDataPath = this.dataPath + File.separator + listenAddr.toString();
final String serverDataPath = this.dataPath + File.separator + listenAddr.toString().replace(':', '_');
FileUtils.forceMkdir(new File(serverDataPath));
nodeOptions.setLogUri(serverDataPath + File.separator + "logs");
nodeOptions.setRaftMetaUri(serverDataPath + File.separator + "meta");
Expand Down Expand Up @@ -168,8 +168,9 @@ public void stopAll() throws InterruptedException {
}

public void clean(Endpoint listenAddr) throws IOException {
System.out.println("Clean dir:" + (this.dataPath + File.separator + listenAddr.toString()));
FileUtils.deleteDirectory(new File(this.dataPath + File.separator + listenAddr.toString()));
final String path = this.dataPath + File.separator + listenAddr.toString().replace(':', '_');
System.out.println("Clean dir:" + path);
FileUtils.deleteDirectory(new File(path));
}

public Node getLeader() {
Expand Down

0 comments on commit 9e19b08

Please sign in to comment.