Skip to content

Commit

Permalink
I should use File.separator for directory separation in path
Browse files Browse the repository at this point in the history
  • Loading branch information
jackygurui committed Apr 20, 2017
1 parent b4978ed commit 6417459
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion redisson/src/test/java/org/redisson/ClusterRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public List<RedisRunner.RedisProcess> run() throws IOException, InterruptedExcep
ArrayList<RedisRunner.RedisProcess> processes = new ArrayList<>();
for (RedisRunner runner : nodes.keySet()) {
List<String> options = getClusterConfig(runner);
String confFile = runner.dir() + File.separatorChar + nodes.get(runner) + ".conf";
String confFile = runner.dir() + File.separator + nodes.get(runner) + ".conf";
System.out.println("WRITING CONFIG: for " + nodes.get(runner));
try (PrintWriter printer = new PrintWriter(new FileWriter(confFile))) {
options.stream().forEach((line) -> {
Expand Down
6 changes: 3 additions & 3 deletions redisson/src/test/java/org/redisson/RedisRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public RedisProcess run() throws IOException, InterruptedException, FailedToStar
public RedisProcess runAndCheck() throws IOException, InterruptedException, FailedToStartRedisException {
List<String> args = new ArrayList(options.values());
if (sentinelFile != null && sentinelFile.length() > 0) {
String confFile = defaultDir + File.pathSeparator + sentinelFile;
String confFile = defaultDir + File.separator + sentinelFile;
try (PrintWriter printer = new PrintWriter(new FileWriter(confFile))) {
args.stream().forEach((arg) -> {
if (arg.contains("--")) {
Expand Down Expand Up @@ -845,7 +845,7 @@ public boolean deleteDBfileDir() {
}

public boolean deleteSentinelFile() {
File f = new File(defaultDir + File.pathSeparator + sentinelFile);
File f = new File(defaultDir + File.separator + sentinelFile);
if (f.exists()) {
System.out.println("REDIS RUNNER: Deleting sentinel config file " + f.getAbsolutePath());
return f.delete();
Expand All @@ -863,7 +863,7 @@ public boolean deleteClusterFile() {
}

private void makeRandomDefaultDir() {
File f = new File(RedissonRuntimeEnvironment.tempDir + File.pathSeparator + UUID.randomUUID());
File f = new File(RedissonRuntimeEnvironment.tempDir + File.separator + UUID.randomUUID());
if (f.exists()) {
makeRandomDefaultDir();
} else {
Expand Down

0 comments on commit 6417459

Please sign in to comment.