remove App class
This commit is contained in:
parent
37f64392da
commit
c14d5866e6
|
@ -1,8 +1,9 @@
|
|||
import net.horizoncode.sysbackup.App;
|
||||
import net.horizoncode.sysbackup.cli.CLIProcessor;
|
||||
|
||||
public class Bootstrapper {
|
||||
|
||||
public static void main(String[] args) {
|
||||
App.getInstance().start(args);
|
||||
CLIProcessor cliProcessor = new CLIProcessor();
|
||||
cliProcessor.startCLI(args);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
package net.horizoncode.sysbackup;
|
||||
|
||||
import net.horizoncode.sysbackup.cli.CLIProcessor;
|
||||
|
||||
public class App {
|
||||
private static App instance;
|
||||
|
||||
public static App getInstance() {
|
||||
if (instance != null) return instance;
|
||||
return instance = new App();
|
||||
}
|
||||
|
||||
public void start(String[] args){
|
||||
CLIProcessor cliProcessor = new CLIProcessor();
|
||||
cliProcessor.startCLI(args);
|
||||
}
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package net.horizoncode.sysbackup.cli;
|
||||
|
||||
import net.horizoncode.sysbackup.App;
|
||||
import net.horizoncode.sysbackup.config.Config;
|
||||
import net.horizoncode.sysbackup.tasks.TaskBuilder;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
@ -73,7 +72,7 @@ public class CLIProcessor {
|
|||
if (!tasksFolder.mkdir()) System.err.println("Failed to create tasks folder!");
|
||||
System.out.println("Saving task config " + fileName + ".toml...");
|
||||
FileUtils.copyInputStreamToFile(
|
||||
Objects.requireNonNull(App.class.getResourceAsStream("/" + "exampletask.toml")),
|
||||
Objects.requireNonNull(getClass().getResourceAsStream("/" + "exampletask.toml")),
|
||||
new File(tasksFolder, fileName + ".toml"));
|
||||
System.out.println(fileName + ".toml saved!");
|
||||
break;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package net.horizoncode.sysbackup.config;
|
||||
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Getter;
|
||||
import net.horizoncode.sysbackup.App;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.tomlj.Toml;
|
||||
import org.tomlj.TomlArray;
|
||||
|
@ -26,7 +24,7 @@ public class Config {
|
|||
if (!configFile.exists()) {
|
||||
try {
|
||||
FileUtils.copyInputStreamToFile(
|
||||
Objects.requireNonNull(App.class.getResourceAsStream("/" + configFile.getName())),
|
||||
Objects.requireNonNull(getClass().getResourceAsStream("/" + configFile.getName())),
|
||||
configFile);
|
||||
justCreated = true;
|
||||
} catch (IOException e) {
|
||||
|
@ -36,7 +34,7 @@ public class Config {
|
|||
if (configFile.isDirectory()) {
|
||||
try {
|
||||
FileUtils.copyInputStreamToFile(
|
||||
Objects.requireNonNull(App.class.getResourceAsStream("/" + configFile.getName())),
|
||||
Objects.requireNonNull(getClass().getResourceAsStream("/" + configFile.getName())),
|
||||
configFile);
|
||||
justCreated = true;
|
||||
} catch (IOException e) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user