From 0e09d2202557c6d1f4fe4eb49642b4fc66e1ea70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemek=20Draga=C5=84czuk?= Date: Fri, 14 Feb 2020 20:17:40 +0100 Subject: [PATCH] Switched to environment instead of property --- src/main/java/tk/draganczuk/url/UrlFile.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/tk/draganczuk/url/UrlFile.java b/src/main/java/tk/draganczuk/url/UrlFile.java index 69e01fc..858a5e2 100644 --- a/src/main/java/tk/draganczuk/url/UrlFile.java +++ b/src/main/java/tk/draganczuk/url/UrlFile.java @@ -7,17 +7,15 @@ import java.nio.file.StandardOpenOption; import java.util.List; import java.util.Optional; -import org.eclipse.jetty.util.log.Log; - public class UrlFile { private File file; 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); - if(! file.exists()){ + if (!file.exists()) { file.createNewFile(); } }