mirror of
https://github.com/bisq-network/bisq.git
synced 2025-01-19 05:44:05 +01:00
Refactor Config#mkdir and #mkAppDataDir
This is a pure refactoring that renames and inlines variables to tighten up and make more consistent the implementation of these two methods. It is done in preparation for a subsequent substantive change that fixes a bug.
This commit is contained in:
parent
de537f0b14
commit
303eadec39
@ -797,14 +797,13 @@ public class Config {
|
||||
* nothing if the directory already exists.
|
||||
* @return the given directory, now guaranteed to exist
|
||||
*/
|
||||
private static File mkAppDataDir(File appDataDir) {
|
||||
Path path = appDataDir.toPath();
|
||||
private static File mkAppDataDir(File dir) {
|
||||
try {
|
||||
Files.createDirectories(path);
|
||||
Files.createDirectories(dir.toPath());
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedIOException(format("Application data directory '%s' could not be created", path), ex);
|
||||
throw new UncheckedIOException(format("Application data directory '%s' could not be created", dir), ex);
|
||||
}
|
||||
return appDataDir;
|
||||
return dir;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -815,11 +814,10 @@ public class Config {
|
||||
private static File mkdir(File parent, String child) {
|
||||
File dir = new File(parent, child);
|
||||
if (!dir.exists()) {
|
||||
Path path = dir.toPath();
|
||||
try {
|
||||
Files.createDirectory(path);
|
||||
Files.createDirectory(dir.toPath());
|
||||
} catch (IOException ex) {
|
||||
throw new UncheckedIOException(format("Directory '%s' could not be created", path), ex);
|
||||
throw new UncheckedIOException(format("Directory '%s' could not be created", dir), ex);
|
||||
}
|
||||
}
|
||||
return dir;
|
||||
|
Loading…
Reference in New Issue
Block a user