104 lines
3.1 KiB
Java
104 lines
3.1 KiB
Java
package org.gcube.dataanalysis.dataminer.poolmanager.util;
|
|
|
|
import java.io.FileInputStream;
|
|
import java.io.FileNotFoundException;
|
|
***REMOVED***
|
|
import java.io.InputStream;
|
|
import java.util.Properties;
|
|
|
|
public class Props {
|
|
public static String home = System.getProperty("user.home");
|
|
|
|
public Props() {
|
|
***REMOVED***
|
|
|
|
public String getCSVUrl() {
|
|
Properties props = new Properties();
|
|
***REMOVED***read from war
|
|
***REMOVED***java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
|
|
|
|
***REMOVED***read from filesystem
|
|
FileInputStream input;
|
|
try {
|
|
input = new FileInputStream(home+"/dataminer-pool-manager/dpmConfig/service.properties");
|
|
***REMOVED*** loading properites from properties file
|
|
try {
|
|
props.load(input);
|
|
***REMOVED*** catch (IOException e) {
|
|
***REMOVED*** TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
***REMOVED***
|
|
***REMOVED*** catch (FileNotFoundException e1) {
|
|
***REMOVED*** TODO Auto-generated catch block
|
|
e1.printStackTrace();
|
|
***REMOVED***
|
|
***REMOVED*** reading propeprty
|
|
String path = props.getProperty("HAPROXY_CSV");
|
|
return path;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
public String getSVNrepo() {
|
|
Properties props = new Properties();
|
|
***REMOVED***read from war
|
|
***REMOVED***java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
|
|
|
|
***REMOVED***read from filesystem
|
|
FileInputStream input;
|
|
try {
|
|
input = new FileInputStream(home+"/dataminer-pool-manager/dpmConfig/service.properties");
|
|
***REMOVED*** loading properites from properties file
|
|
try {
|
|
props.load(input);
|
|
***REMOVED*** catch (IOException e) {
|
|
***REMOVED*** TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
***REMOVED***
|
|
***REMOVED*** catch (FileNotFoundException e1) {
|
|
***REMOVED*** TODO Auto-generated catch block
|
|
e1.printStackTrace();
|
|
***REMOVED***
|
|
***REMOVED*** reading propeprty
|
|
String path = props.getProperty("SVN_REPO");
|
|
return path;
|
|
|
|
***REMOVED***
|
|
|
|
|
|
|
|
public String getStagingHost() {
|
|
Properties props = new Properties();
|
|
***REMOVED***read from war
|
|
***REMOVED***java.io.InputStream input = Props.class.getClassLoader().getResourceAsStream("service.properties");
|
|
|
|
***REMOVED***read from filesystem
|
|
FileInputStream input;
|
|
try {
|
|
input = new FileInputStream(home+"/dataminer-pool-manager/dpmConfig/service.properties");
|
|
***REMOVED*** loading properites from properties file
|
|
try {
|
|
props.load(input);
|
|
***REMOVED*** catch (IOException e) {
|
|
***REMOVED*** TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
***REMOVED***
|
|
***REMOVED*** catch (FileNotFoundException e1) {
|
|
***REMOVED*** TODO Auto-generated catch block
|
|
e1.printStackTrace();
|
|
***REMOVED***
|
|
|
|
***REMOVED*** reading propeprty
|
|
String path = props.getProperty("STAGING_HOST");
|
|
return path;
|
|
|
|
***REMOVED***
|
|
|
|
public static void main(String[] args) throws FileNotFoundException {
|
|
Props a = new Props();
|
|
System.out.println(new Props().getSVNrepo());
|
|
System.out.println(a.getStagingHost());
|
|
System.out.println(a.getCSVUrl());
|
|
***REMOVED***
|
|
***REMOVED***
|