mirror of
https://github.com/corda/corda.git
synced 2024-12-29 09:18:58 +00:00
Better usage of Paths vs File API.
This commit is contained in:
parent
455cdba5d9
commit
7ea2dbdd77
@ -1,9 +1,10 @@
|
|||||||
package net.corda.demobench.config;
|
package net.corda.demobench.config;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.logging.LogManager;
|
import java.util.logging.LogManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -24,8 +25,8 @@ public class LoggingConfig {
|
|||||||
ClassLoader classLoader = LoggingConfig.class.getClassLoader();
|
ClassLoader classLoader = LoggingConfig.class.getClassLoader();
|
||||||
InputStream input = classLoader.getResourceAsStream("logging.properties");
|
InputStream input = classLoader.getResourceAsStream("logging.properties");
|
||||||
if (input == null) {
|
if (input == null) {
|
||||||
File javaHome = new File(System.getProperty("java.home"));
|
Path javaHome = Paths.get(System.getProperty("java.home"));
|
||||||
input = new FileInputStream(new File(new File(javaHome, "lib"), "logging.properties"));
|
input = Files.newInputStream(javaHome.resolve("lib").resolve("logging.properties"));
|
||||||
}
|
}
|
||||||
return input;
|
return input;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ class NodeController : Controller() {
|
|||||||
confFile.writeText(fileData.root().render(renderOptions))
|
confFile.writeText(fileData.root().render(renderOptions))
|
||||||
|
|
||||||
// Nodes cannot issue cash unless they contain the "Bank of Corda" plugin.
|
// Nodes cannot issue cash unless they contain the "Bank of Corda" plugin.
|
||||||
if (config.isCashIssuer && bankOfCorda.isFile()) {
|
if (config.isCashIssuer && bankOfCorda.isFile) {
|
||||||
log.info("Installing 'Bank of Corda' plugin")
|
log.info("Installing 'Bank of Corda' plugin")
|
||||||
bankOfCorda.copyTo(nodeDir.resolve("plugins").resolve(bankOfCorda.name))
|
bankOfCorda.copyTo(nodeDir.resolve("plugins").resolve(bankOfCorda.name))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user