mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2024-11-01 08:39:31 +01:00
Move mock path determining to the dataDirectory method
This commit is contained in:
parent
ebe072858e
commit
88ef85c65e
@ -43,16 +43,14 @@ public class MockDiscordSRV extends AbstractDiscordSRV<MainConfig, ConnectionCon
|
|||||||
|
|
||||||
private final Scheduler scheduler = new StandardScheduler(this);
|
private final Scheduler scheduler = new StandardScheduler(this);
|
||||||
private final Logger logger = JavaLoggerImpl.getRoot();
|
private final Logger logger = JavaLoggerImpl.getRoot();
|
||||||
private final Path path;
|
private Path path;
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
new MockDiscordSRV();
|
||||||
|
}
|
||||||
|
|
||||||
public MockDiscordSRV() {
|
public MockDiscordSRV() {
|
||||||
load();
|
load();
|
||||||
|
|
||||||
Path path = Paths.get("/tmp/discordsrv-test");
|
|
||||||
try {
|
|
||||||
path = Files.createTempDirectory("discordsrv-test");
|
|
||||||
} catch (IOException ignored) {}
|
|
||||||
this.path = path;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -62,6 +60,14 @@ public class MockDiscordSRV extends AbstractDiscordSRV<MainConfig, ConnectionCon
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Path dataDirectory() {
|
public Path dataDirectory() {
|
||||||
|
if (this.path == null) {
|
||||||
|
Path path = Paths.get("/tmp/discordsrv-test");
|
||||||
|
try {
|
||||||
|
path = Files.createTempDirectory("discordsrv-test");
|
||||||
|
} catch (IOException ignored) {}
|
||||||
|
this.path = path;
|
||||||
|
}
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user