set Properties - Java java.util

Java examples for java.util:Properties File

Description

set Properties

Demo Code


import java.io.IOException;
import java.util.Properties;

public class Main{
    private static Properties props = null;
    private final static void setProperties(){
      props = new Properties();
      try {//  ww  w.  j a v a2s. co  m
         props.load(Main.class.getResourceAsStream("/server/config/server.properties"));
      } catch (IOException e) {
         props = null;
         e.printStackTrace();
      }
   }
}

Related Tutorials