dataminer-pool-manager/src/main/java/org/gcube/dataanalysis/dataminer/poolmanager/util/Props.java

104 lines
3.3 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 ***REMOVED***
public static String home = System.getProperty("user.home");
public Props() ***REMOVED***
***REMOVED***
public String getCSVUrl() ***REMOVED***
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 ***REMOVED***
input = new FileInputStream(home+"/dataminer-pool-manager/dpmConfig/service.properties");
***REMOVED*** loading properites from properties file
try ***REMOVED***
props.load(input);
***REMOVED*** catch (IOException e) ***REMOVED***
***REMOVED*** TODO Auto-generated catch block
e.printStackTrace();
***REMOVED***
***REMOVED*** catch (FileNotFoundException e1) ***REMOVED***
***REMOVED*** TODO Auto-generated catch block
e1.printStackTrace();
***REMOVED***
***REMOVED*** reading propeprty
String path = props.getProperty("HAPROXY_CSV");
return path;
***REMOVED***
public String getSVNrepo() ***REMOVED***
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 ***REMOVED***
input = new FileInputStream(home+"/dataminer-pool-manager/dpmConfig/service.properties");
***REMOVED*** loading properites from properties file
try ***REMOVED***
props.load(input);
***REMOVED*** catch (IOException e) ***REMOVED***
***REMOVED*** TODO Auto-generated catch block
e.printStackTrace();
***REMOVED***
***REMOVED*** catch (FileNotFoundException e1) ***REMOVED***
***REMOVED*** TODO Auto-generated catch block
e1.printStackTrace();
***REMOVED***
***REMOVED*** reading propeprty
String path = props.getProperty("SVN_REPO");
return path;
***REMOVED***
public String getStagingHost() ***REMOVED***
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 ***REMOVED***
input = new FileInputStream(home+"/dataminer-pool-manager/dpmConfig/service.properties");
***REMOVED*** loading properites from properties file
try ***REMOVED***
props.load(input);
***REMOVED*** catch (IOException e) ***REMOVED***
***REMOVED*** TODO Auto-generated catch block
e.printStackTrace();
***REMOVED***
***REMOVED*** catch (FileNotFoundException e1) ***REMOVED***
***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 ***REMOVED***
Props a = new Props();
System.out.println(new Props().getSVNrepo());
System.out.println(a.getStagingHost());
System.out.println(a.getCSVUrl());
***REMOVED***
***REMOVED***