Skip to content
This repository was archived by the owner on Jun 17, 2024. It is now read-only.

Commit f73b358

Browse files
committed
feat: ✨ add sentence url to config
1 parent d93e178 commit f73b358

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/main/java/org/bsrserver/components/Sentences.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.w3c.dom.Document;
1111
import org.w3c.dom.Node;
1212
import org.w3c.dom.NodeList;
13+
import org.bsrserver.config.Config;
1314

1415
public class Sentences {
1516
private final ArrayList<String> sentences = new ArrayList<>();
@@ -22,7 +23,7 @@ private void updateSentences() {
2223
sentences.clear();
2324
try {
2425
// request
25-
URL url = new URL("https://www.bsrserver.org:8443/static?prefix=pages/gifs/");
26+
URL url = new URL(Config.getInstance().getSentencesUrl());
2627
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
2728
connection.setRequestMethod("GET");
2829
Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(connection.getInputStream());

src/main/java/org/bsrserver/config/Config.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,8 @@ public String getDatabasePassword() {
5353
public String getDatabaseTable() {
5454
return configToml.getString("database.table");
5555
}
56+
57+
public String getSentencesUrl() {
58+
return configToml.getString("sentences.url");
59+
}
5660
}

src/main/resources/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ url = 'jdbc:postgresql://localhost:5432/postgres'
33
user = 'postgres'
44
password = ''
55
table = 'postgres'
6+
7+
[sentences]
8+
url = 'http://minio:9000/frontend?prefix=pages/gifs/'

0 commit comments

Comments
 (0)