Package java.util

Examples of java.util.Properties.load()


    Properties props = new Properties();
    final InputStream inStream = ObjectUtilities.getResourceAsStream
        ("testsettings.properties", BaseTest.class);
    try
    {
      props.load(inStream);//$NON-NLS-1$
    }
    finally
    {
      inStream.close();
    }
View Full Code Here


        IoUtils.delete(TEST_DIR);
    }

    public void testRefresh() throws FileNotFoundException, IOException {
      Properties users = new Properties();
      users.load(new FileInputStream(USERS_FILE));
      String originalSetting = users.getProperty("ftpserver.user.user1.homedirectory");
      users.setProperty("ftpserver.user.user1.homedirectory", "refresh_test");
      users.store(new FileOutputStream(USERS_FILE), null);
     
      PropertiesUserManager pum = (PropertiesUserManager) userManager;
View Full Code Here

      PropertiesUserManager pum = (PropertiesUserManager) userManager;
      pum.refresh();
      User modifiedUser = pum.getUserByName("user1");
      assertEquals("Home directory should have been \"refresh_test\" after call to refresh().","refresh_test",modifiedUser.getHomeDirectory());
      // set everything back again
      users.load(new FileInputStream(USERS_FILE));
      users.setProperty("ftpserver.user.user1.homedirectory", originalSetting);
      users.store(new FileOutputStream(USERS_FILE), null);
     
      pum.refresh();
      //check everything is back again
View Full Code Here

    return version.toString();
  }
 
  public static Version determineWGAVersion(InputStream wgabuildProperties) throws IOException {
    Properties props = new Properties();
    props.load(wgabuildProperties);
    Version version = new Version();
    if (props.getProperty("majorVersion") != null) {
      version.setMajorVersion(Integer.parseInt(props.getProperty("majorVersion")));
    }
    if (props.getProperty("minorVersion") != null) {
View Full Code Here

        try {
            Properties properties = new Properties();
            // Read in the properties.
            URL propertiesURL = new URL(propertiesFile);
            InputStream is = propertiesURL.openStream();
            properties.load(is);

            // Let's make a file
            ShapeLayer sl = new ShapeLayer();
            sl.setProperties(prefix, properties);
View Full Code Here

        if (retvalue != JFileChooser.APPROVE_OPTION) {
            return props;
        }
        try {
            FileInputStream inputStream = new FileInputStream(fileChooser.getSelectedFile());
            props.load(inputStream);
            return props;
        } catch (Exception ioe) {
            System.err.println("PropUtils.promptUserForProperties: Exception reading properties file.");
            System.err.println(ioe.getMessage());
            ioe.printStackTrace();
View Full Code Here

    public static Properties getPropertiesFromStream(InputStream is) {
        if (is == null)
            return null;
        Properties props = new Properties();
        try {
            props.load(is);
        } catch (IOException e) {
            log.error("Error loading properties from stream.", e);
        } finally {
            if (is != null)
                try {
View Full Code Here

            }

            // if we've got something, load 'er up
            if (in != null) {
                log.info("Initializing velocity using '" + configfile + "'");
                properties.load(in);
            }
        } catch (IOException e) {
            log.warn("Unable to load velocity configuration file '" + configfile + "'", e);
        } finally {
            if (in != null) {
View Full Code Here

   
    paintColorTo = 0;

    Properties properties = new Properties();
    try {
      properties.load(AboutWindow.class.getClassLoader().getResourceAsStream("org/gudy/azureus2/ui/swt/about.properties"));
    }
    catch (Exception e1) {
      Debug.printStackTrace( e1 );
      return;
    }
View Full Code Here

                ProjectionFactory.loadDefaultProjections();
                URL url = PropUtils.getResourceOrFileOrURL(null, ps);
                InputStream inputStream = url.openStream();

                props = new Properties();
                props.load(inputStream);

                Projection proj = null;

                String finalOutputPath = ImageServer.createImageFile(null,
                        props,
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.