-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDataLoader.java
More file actions
31 lines (25 loc) · 994 Bytes
/
DataLoader.java
File metadata and controls
31 lines (25 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.spotify.oauth2.utils;
import java.util.Properties;
public class DataLoader {
private final Properties properties;
private static DataLoader dataLoader;
private DataLoader(){
properties = PropertyUtils.propertyLoader("src/test/resources/data.properties");
}
public static DataLoader getInstance(){
if(dataLoader == null){
dataLoader = new DataLoader();
}
return dataLoader;
}
public String getGetPlaylistId(){
String prop = properties.getProperty("get_playlist_id");
if(prop != null) return prop;
else throw new RuntimeException("property get_playlist_id is not specified in the data.properties file");
}
public String getUpdatePlaylistId(){
String prop = properties.getProperty("update_playlist_id");
if(prop != null) return prop;
else throw new RuntimeException("property update_playlist_id is not specified in the data.properties file");
}
}