Java Code Examples for org.csource.common.IniFileReader

The following examples show how to use org.csource.common.IniFileReader. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * load from properties file
 *
 * @param propsFilePath properties file path, eg:
 *                      "fastdfs-client.properties"
 *                      "config/fastdfs-client.properties"
 *                      "/opt/fastdfs-client.properties"
 *                      "C:\\Users\\James\\config\\fastdfs-client.properties"
 *                      properties文件至少包含一个配置项 fastdfs.tracker_servers 例如:
 *                      fastdfs.tracker_servers = 10.0.11.245:22122,10.0.11.246:22122
 *                      server的IP和端口用冒号':'分隔
 *                      server之间用逗号','分隔
 */
public static void initByProperties(String propsFilePath) throws IOException, FastdfsException {
    Properties props = new Properties();
    InputStream in = IniFileReader.loadFromOsFileSystemOrClasspathAsStream(propsFilePath);
    if (in != null) {
        props.load(in);
    }
    initByProperties(props);
}
 
Example 2
/**
 * load from properties file
 *
 * @param propsFilePath properties file path, eg:
 *                      "fastdfs-client.properties"
 *                      "config/fastdfs-client.properties"
 *                      "/opt/fastdfs-client.properties"
 *                      "C:\\Users\\James\\config\\fastdfs-client.properties"
 *                      properties文件至少包含一个配置项 fastdfs.tracker_servers 例如:
 *                      fastdfs.tracker_servers = 10.0.11.245:22122,10.0.11.246:22122
 *                      server的IP和端口用冒号':'分隔
 *                      server之间用逗号','分隔
 */
public static void initByProperties(String propsFilePath) throws IOException, MyException {
  Properties props = new Properties();
  InputStream in = IniFileReader.loadFromOsFileSystemOrClasspathAsStream(propsFilePath);
  if (in != null) {
    props.load(in);
  }
  initByProperties(props);
}