1
0
Fork 0
mirror of https://github.com/SinTan1729/chhoto-url synced 2024-12-26 07:38:36 -06:00

Switched to environment instead of property

This commit is contained in:
Przemek Dragańczuk 2020-02-14 20:17:40 +01:00
parent 20881d85d4
commit 0e09d22025

View file

@ -7,17 +7,15 @@ import java.nio.file.StandardOpenOption;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import org.eclipse.jetty.util.log.Log;
public class UrlFile { public class UrlFile {
private File file; private File file;
public UrlFile() throws IOException{ public UrlFile() throws IOException{
String path = System.getProperty("file.location", "./urls.csv"); String path = System.getenv().getOrDefault("file.location", "./urls.csv");
this.file = new File(path); this.file = new File(path);
if(! file.exists()){ if (!file.exists()) {
file.createNewFile(); file.createNewFile();
} }
} }