92 lines
2.3 KiB
Java
92 lines
2.3 KiB
Java
|
package org.gcube.dataanalysis.dataminer.poolmanager.util;
|
||
|
|
||
|
import java.io.FileInputStream;
|
||
|
import java.io.FileNotFoundException;
|
||
|
***REMOVED***
|
||
|
import java.util.Properties;
|
||
|
|
||
|
public class ServiceConfiguration {
|
||
|
public static String home = System.getProperty("user.home");
|
||
|
|
||
|
private Properties props;
|
||
|
|
||
|
public ServiceConfiguration() {
|
||
|
this(home+"/dataminer-pool-manager/dpmConfig/service.properties");
|
||
|
***REMOVED***
|
||
|
|
||
|
public ServiceConfiguration(String configFile) {
|
||
|
this.props = new Properties();
|
||
|
|
||
|
FileInputStream input;
|
||
|
|
||
|
try {
|
||
|
input = new FileInputStream(configFile);
|
||
|
***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***
|
||
|
|
||
|
|
||
|
|
||
|
public String getSVNRepository(){
|
||
|
return props.getProperty("svn.repository");
|
||
|
***REMOVED***
|
||
|
|
||
|
public String getSVNRProtoAlgorithmsList(){
|
||
|
return props.getProperty("svn.rproto.algorithms-list");
|
||
|
***REMOVED***
|
||
|
|
||
|
public String getSVNRProtoOSDepsList(){
|
||
|
return props.getProperty("svn.rproto.deps-os");
|
||
|
***REMOVED***
|
||
|
|
||
|
public String getSVNRProtoCRANDepsList(){
|
||
|
return props.getProperty("svn.rproto.deps-cran");
|
||
|
***REMOVED***
|
||
|
|
||
|
public String getSVNRProtoGitHubDepsList(){
|
||
|
return props.getProperty("svn.rproto.deps-github");
|
||
|
***REMOVED***
|
||
|
|
||
|
public String getSVNProdAlgorithmsList(){
|
||
|
return props.getProperty("svn.prod.algorithms-list");
|
||
|
***REMOVED***
|
||
|
|
||
|
public String getSVNProdOSDepsList(){
|
||
|
return props.getProperty("svn.prod.deps-os");
|
||
|
***REMOVED***
|
||
|
|
||
|
public String getSVNRProdCRANDepsList(){
|
||
|
return props.getProperty("svn.prod.deps-cran");
|
||
|
***REMOVED***
|
||
|
|
||
|
public String getSVNRProdGitHubDepsList(){
|
||
|
return props.getProperty("svn.prod.deps-github");
|
||
|
***REMOVED***
|
||
|
|
||
|
public String getCSVUrl() {
|
||
|
return props.getProperty("HAPROXY_CSV");
|
||
|
***REMOVED***
|
||
|
|
||
|
|
||
|
public String getStagingHost() {
|
||
|
return props.getProperty("STAGING_HOST");
|
||
|
***REMOVED***
|
||
|
|
||
|
public static void main(String[] args) throws FileNotFoundException {
|
||
|
ServiceConfiguration a = new ServiceConfiguration();
|
||
|
System.out.println(a.getStagingHost());
|
||
|
System.out.println(a.getCSVUrl());
|
||
|
***REMOVED***
|
||
|
|
||
|
|
||
|
***REMOVED***
|