initial commit DataBase branche
This commit is contained in:
parent
ff5bfc409b
commit
cdc5dddb80
4
src/config.properties
Normal file
4
src/config.properties
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
URL = https://influx.sdi.hevs.ch
|
||||||
|
ORG = SIn15
|
||||||
|
BUCKET = SIn15
|
||||||
|
TOKEN = ${SECRET_TOKEN}
|
@ -4,7 +4,9 @@ package ch.hevs.isi.db;
|
|||||||
import ch.hevs.isi.core.DataPoint;
|
import ch.hevs.isi.core.DataPoint;
|
||||||
import ch.hevs.isi.core.DataPointListener;
|
import ch.hevs.isi.core.DataPointListener;
|
||||||
|
|
||||||
|
|
||||||
public class DatabaseConnector implements DataPointListener {
|
public class DatabaseConnector implements DataPointListener {
|
||||||
|
String token = "bW6-s_EkTkZ-rT-Mj0kt1uZQYOPKio5FdEK-OtwWJlxDwYQ5OkH599t1jUz4VV47SrkKonLDHB0jRJ3Eu6OUTA==";
|
||||||
private static DatabaseConnector mySelf = null;
|
private static DatabaseConnector mySelf = null;
|
||||||
|
|
||||||
private DatabaseConnector (){
|
private DatabaseConnector (){
|
||||||
|
18
src/test/java/Database.java
Normal file
18
src/test/java/Database.java
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
|
||||||
|
public class Database {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Properties properties = new Properties();
|
||||||
|
try (InputStream input = new FileInputStream("src/config.properties")) {
|
||||||
|
properties.load(input);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
String token = properties.getProperty("TOKEN");
|
||||||
|
|
||||||
|
System.out.println(token);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user