Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.infa.eic.sample;
- import java.io.FileNotFoundException;
- import java.io.IOException;
- import java.io.InputStream;
- import java.util.Date;
- import java.util.Properties;
- public class getprop {
- InputStream inputStream;
- public List<String> getPropValues() throws IOException {
- try {
- Properties prop = new Properties();
- String propFileName = "application.properties";
- inputStream = getClass().getClassLoader().getResourceAsStream(propFileName);
- if (inputStream != null) {
- prop.load(inputStream);
- } else {
- throw new FileNotFoundException("property file '" + propFileName + "' not found in the classpath");
- }
- Date time = new Date(System.currentTimeMillis());
- String truststore = prop.getProperty("truststore");
- String truststorepass = prop.getProperty("truststorepass");
- String url = prop.getProperty("url");
- String user = prop.getProperty("user");
- string pass = prop.getProperty("pass");
- List<String> listaWartosci = new ArrayList<>();
- listaWartosci.add(truststore);
- listaWartosci.add(truststorepass);
- listaWartosci.add(user);
- listaWartosci.add(pass);
- } catch (Exception e) {
- System.out.println("Exception: " + e);
- } finally {
- inputStream.close();
- }
- return listaWartosci;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement