aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/utility/SpotifyAPI.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/utility/SpotifyAPI.java')
-rw-r--r--src/main/java/utility/SpotifyAPI.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/main/java/utility/SpotifyAPI.java b/src/main/java/utility/SpotifyAPI.java
index 4eb4d6e..acf79eb 100644
--- a/src/main/java/utility/SpotifyAPI.java
+++ b/src/main/java/utility/SpotifyAPI.java
@@ -83,15 +83,11 @@ public class SpotifyAPI {
}
}
public static String readSetting(String parameter){
- Object obj = null;
-
- try {
- obj = new JSONParser().parse(new FileReader("settings//config.json"));
- } catch (Exception e) {
- e.printStackTrace();
+ String value = System.getenv(parameter);
+ if (value != null) {
+ return value;
}
- JSONObject jo = (JSONObject) obj;
- return (String) jo.get(parameter);
+ throw new RuntimeException("Environment variable " + parameter + " not found");
}
public static void checkRefreshToken(){
long unixTime = Instant.now().getEpochSecond();
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage