Examples of PropertiesReader


Examples of bm.core.PropertiesReader

                    {
                        throw new IOException( "Not found: " + fileName );
                    }
                    else
                    {
                        final PropertiesReader r = new PropertiesReader( is );
                        String[] pair = r.next();
                        while( pair != null )
                        {
                            log.debug( "pair: " + pair[0] + " = " + pair[1] );
                            index.insertObject( pair[0], pair[1] );
                            pair = r.next();
                        }
                        is.close();
                        System.gc();
                    }
                }
View Full Code Here

Examples of com.github.diamond.client.config.PropertiesReader

   * @throws Exception
   */
  public void load(Reader in, boolean reload) throws ConfigurationRuntimeException {
    Map<String, String> tmpStore = new LinkedHashMap<String, String>();
   
    PropertiesReader reader = new PropertiesReader(in);
    try {
      while (reader.nextProperty()) {
        String key = reader.getPropertyName();
        String value = reader.getPropertyValue();
        tmpStore.put(key, value);
        if(reload) {
          String oldValue = store.remove(key);
          if(oldValue == null)
            fireEvent(EventType.ADD, key, value);
          else if(!oldValue.equals(value))
            fireEvent(EventType.UPDATE, key, value);
        }
      }
     
      if(reload) {
        for(String key : store.keySet()) {
          fireEvent(EventType.CLEAR, key, store.get(key));
        }
      }
    } catch (IOException ioex) {
      throw new ConfigurationRuntimeException(ioex);
    } finally {
      try {
        reader.close();
      } catch (IOException e) {
        ;
      }
    }
   
View Full Code Here

Examples of com.ipc.oce.PropertiesReader

*/
public class Sample1 {

  public static void main(String[] args) throws IOException, ConfigurationException {
    // step 1 load properties via configuration file
    PropertiesReader pr = new PropertiesReader(new File("C:\\Developer\\Projects\\hel_default\\OCExportWeb\\WebContent\\WEB-INF\\oce.properties"));
   
   
    Properties configuration = pr.getPropertiesForInstance("inst01");
   
    // [step 2] load application driver (or use you can use default)
    ApplicationDriver driver = ApplicationDriver
        .loadDriver((String) configuration
            .get(PropertiesReader.OCE_CFG_DRIVER));
View Full Code Here

Examples of com.ipc.oce.PropertiesReader

  private Sample2() {
    super();
  }
 
  private static OCApp getConnection() throws JIException, IOException, ConfigurationException{
    PropertiesReader pr = new PropertiesReader(new File("C:\\Developer\\Projects\\hel_default\\OCExportWeb\\WebContent\\WEB-INF\\oce.properties"));
    Properties configuration = pr.getPropertiesForInstance("inst01");
    ApplicationDriver driver = ApplicationDriver
        .loadDriver((String) configuration
            .get(PropertiesReader.OCE_CFG_DRIVER));
    OCApp app = OCApp.getNewInstance();
    app.setApplicationDriver(driver);
View Full Code Here

Examples of com.ipc.oce.PropertiesReader

  private Sample3() {
    super();
  }
 
  private static OCApp getConnection() throws JIException, IOException, ConfigurationException{
    PropertiesReader pr = new PropertiesReader(new File("C:\\Developer\\Projects\\hel_default\\OCExportWeb\\WebContent\\WEB-INF\\oce.properties"));
    Properties configuration = pr.getPropertiesForInstance("buh");
    ApplicationDriver driver = ApplicationDriver
        .loadDriver((String) configuration
            .get(PropertiesReader.OCE_CFG_DRIVER));
    OCApp app = OCApp.getNewInstance();
    app.setApplicationDriver(driver);
View Full Code Here

Examples of com.ipc.oce.PropertiesReader

  private static OCApp app = null;
  private int sessionNum = -1;
 
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    PropertiesReader pr = new PropertiesReader(
        new File(
            "C:\\Developer\\Projects\\hel_default\\OCExportWeb\\WebContent\\WEB-INF\\oce.properties"));

    configuration = pr.getPropertiesForInstance("inst03");

    // [step 2] load application driver (or use you can use default)
    ApplicationDriver driver = ApplicationDriver
        .loadDriver((String) configuration
            .get(PropertiesReader.OCE_CFG_DRIVER));
View Full Code Here

Examples of com.ipc.oce.PropertiesReader

  protected static OCApp app = null;
  protected int sessionNum = -1;
 
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    PropertiesReader pr = new PropertiesReader(
        new File(
            "C:\\Developer\\Projects\\hel_default\\OCExportWeb\\WebContent\\WEB-INF\\oce.properties"));

    configuration = pr.getPropertiesForInstance("buh");

    // [step 2] load application driver (or use you can use default)
    ApplicationDriver driver = ApplicationDriver
        .loadDriver((String) configuration
            .get(PropertiesReader.OCE_CFG_DRIVER));
View Full Code Here

Examples of com.ipc.oce.PropertiesReader

  private static Properties configuration = null;
  private static OCApp app = null;
 
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    PropertiesReader pr = new PropertiesReader(
        new File("C:\\Developer\\Projects\\hel_default\\OCExportWeb\\WebContent\\WEB-INF\\oce.properties"));

    configuration = pr.getPropertiesForInstance("buh");

    // [step 2] load application driver (or use you can use default)
    ApplicationDriver driver = ApplicationDriver
        .loadDriver((String) configuration
            .get(PropertiesReader.OCE_CFG_DRIVER));
View Full Code Here

Examples of com.ipc.oce.PropertiesReader

  /**
   * @throws java.lang.Exception
   */
  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    PropertiesReader pr = new PropertiesReader(
        new File(
            "C:\\Developer\\Projects\\hel_default\\OCExportWeb\\WebContent\\WEB-INF\\oce.properties"));

    configuration = pr.getPropertiesForInstance("buh");

    // [step 2] load application driver (or use you can use default)
    ApplicationDriver driver = ApplicationDriver
        .loadDriver((String) configuration
            .get(PropertiesReader.OCE_CFG_DRIVER));
View Full Code Here

Examples of com.ipc.oce.PropertiesReader

    // check init parameters
    Properties configuration = null;
    String cfgPath = servletConfig.getInitParameter(CONFIG_FILE_PATH);
    String instanceName = servletConfig.getInitParameter(CONFIG_INST_NAME);
    if (cfgPath != null) {
      PropertiesReader pr = new PropertiesReader(new File(cfgPath));
      configuration = pr.getPropertiesForInstance(
          instanceName != null ? instanceName : PropertiesReader.OCE_DEFAULT_INSTANCE
          );
     
    } else {
      String driver = servletConfig.getInitParameter(PropertiesReader.OCE_CFG_DRIVER);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.