Package java.util

Examples of java.util.Properties.load()


    Properties props = new Properties();
    InputStream inputStream = null;
    try {
      log.info("Reading Dozer properties from URL [{}]", url);
      inputStream = url.openStream();
      props.load(inputStream);
    } catch (IOException e) {
      MappingUtils.throwMappingException("Problem loading Dozer properties from URL [" + propFileName + "]", e);
    } finally {
      if (inputStream != null) {
        try {
View Full Code Here


        System.out.println("No properties file: " + propertyName + " found");
      } else {
        Properties bundle = new Properties();
        InputStream is = url.openStream();
        if (is != null) {
          bundle.load(is);
          is.close();
        } else {
          throw new IOException("Properties file " + propertyName  + " not available");
        }
        Enumeration<?> propertyNames = bundle.propertyNames();
View Full Code Here

      }
      new WorkingMemoryDbLogger(ksession);
      CommandBasedWSHumanTaskHandler handler = new CommandBasedWSHumanTaskHandler(ksession);
      properties = new Properties();
      try {
        properties.load(CommandDelegate.class.getResourceAsStream("/jbpm.console.properties"));
      } catch (IOException e) {
        throw new RuntimeException("Could not load jbpm.console.properties", e);
      }
      handler.setConnection(
        properties.getProperty("jbpm.console.task.service.host"),
View Full Code Here

        }
        Properties properties = new Properties();
        try {
            FileInputStream inStream = new FileInputStream(propertiesFile);
            try {
                properties.load(inStream);
            } finally {
                inStream.close();
            }
        } catch (IOException e) {
            throw new RuntimeException("Error when loading properties file=" + propertiesFile, e);
View Full Code Here

    public void execute(String[] args, Install install, BootstrapMainStarter bootstrapMainStarter) throws Exception {
        Properties wrapperProperties = new Properties();
        InputStream inStream = new FileInputStream(new File(System.getProperty(WRAPPER_PROPERTIES_PROPERTY)));
        try {
            wrapperProperties.load(inStream);
        } finally {
            inStream.close();
        }
        if (GradleWrapperMain.isDebug()) {
            System.out.println("wrapperProperties = " + wrapperProperties);
View Full Code Here

        bootstrapMainStarterMock = context.mock(BootstrapMainStarter.class);
        installMock = context.mock(Install.class);
        propertiesDir.mkdirs();
        propertiesFile = new File(propertiesDir, "wrapper.properties");
        Properties testProperties = new Properties();
        testProperties.load(WrapperTest.class.getResourceAsStream("/org/gradle/wrapper/wrapper.properties"));
        testProperties.store(new FileOutputStream(propertiesFile), null);
        System.setProperty(Wrapper.WRAPPER_PROPERTIES_PROPERTY, propertiesFile.getCanonicalPath());
    }

    @After
View Full Code Here

        in = url.openStream();
      }
      else {
        in = new FileInputStream(propFileName);
      }
      props.load(in);
      in.close();
      aConfig = new AppConfig(props);
    }
    catch (Exception e) {
      logger.fatal("GenericAppRunner:  Error initializing AppConfig.  Exception: " + e.getMessage());
View Full Code Here

        File userFile = new File(args[0]);
        Properties users = new Properties();
        if( userFile.exists() ) {
            InputStream is = new BufferedInputStream( new FileInputStream( userFile ) );
            users.load( is );
            is.close();
        }

        System.out.println("Creating hash for " + args[1]);
        users.setProperty( args[1], hashPassword( args[2]) );
View Full Code Here

  private JRestClient client;

  public RemoteServiceDynamicProxy() {
    Properties property = new Properties();
    try {
      property.load(this.getClass().getClassLoader().getResourceAsStream(
          "remote.properties"));
    } catch (Exception e) {
      throw new RuntimeException("在Classpath中无法获取remote.properties文件");
    }
View Full Code Here

  public static void initializeLogging() throws GUIException {
    try {
     
      URL url = GUIUtils.class.getResource("/resources/xmlgui/log4j.properties");
      Properties properties = new Properties();
      properties.load(url.openStream());
      PropertyConfigurator.configure(properties);
    } catch (Exception e) {
      throw new GUIException("Error while initializing logging", e);
    }
  }
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.