mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 23:18:17 +01:00
In case the BSQ blocks directory does not exist in resources (as in case of REG_TEST)
we do not want to log an error stacktrace but just an info message. Use `File.separator` instead of "/"
This commit is contained in:
parent
f3d2cc38dc
commit
d74bffb595
1 changed files with 6 additions and 4 deletions
|
@ -22,6 +22,7 @@ import bisq.core.dao.state.model.blockchain.Block;
|
|||
|
||||
import bisq.common.config.Config;
|
||||
import bisq.common.file.FileUtil;
|
||||
import bisq.common.file.ResourceNotFoundException;
|
||||
import bisq.common.proto.persistable.PersistenceProtoResolver;
|
||||
|
||||
import protobuf.BaseBlock;
|
||||
|
@ -104,10 +105,9 @@ public class BsqBlocksStorageService {
|
|||
|
||||
void copyFromResources(String postFix) {
|
||||
long ts = System.currentTimeMillis();
|
||||
try {
|
||||
String dirName = BsqBlocksStorageService.NAME;
|
||||
String resourceDir = dirName + postFix;
|
||||
|
||||
try {
|
||||
if (storageDir.exists()) {
|
||||
log.info("No resource directory was copied. {} exists already.", dirName);
|
||||
return;
|
||||
|
@ -123,9 +123,11 @@ public class BsqBlocksStorageService {
|
|||
}
|
||||
for (String fileName : fileNames) {
|
||||
File destinationFile = new File(storageDir, fileName);
|
||||
FileUtil.resourceToFile(resourceDir + "/" + fileName, destinationFile);
|
||||
FileUtil.resourceToFile(resourceDir + File.separator + fileName, destinationFile);
|
||||
}
|
||||
log.info("Copying {} resource files took {} ms", fileNames.size(), System.currentTimeMillis() - ts);
|
||||
} catch (ResourceNotFoundException ignore) {
|
||||
log.info("Directory {} in resources does not exist.", resourceDir);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue