Package java.util

Examples of java.util.Properties.load()


      is = ResourceActions.openStream(url);
    } catch (PrivilegedActionException e) {
      throw new IOException(e.getLocalizedMessage());
    }
    if (is != null) {
      bundle.load(is);
      is.close();
    } else {
      throw new IOException("Properties file " + propertiesName + " not available");//$NON-NLS-1$ //$NON-NLS-2$
    }
    log.debug("Loaded properties, users=" + bundle.keySet());//$NON-NLS-1$
View Full Code Here


    public static Properties load(String fileName) throws IOException {
        InputStream is = null;
        try {
            Properties props = new Properties();
            is = new FileInputStream(fileName);
            props.load(is);
            return props;
        } finally {
            if (is != null) {
                is.close();
            }
View Full Code Here

    public static Properties loadFromURL(URL url) throws MalformedURLException, IOException {
        Properties result = new Properties();
        InputStream is = null;
        try {
          is = url.openStream();
          result.load(is);
        } finally {
          if (is != null) {
            is.close();
          }
        }
View Full Code Here

        Properties configProps = new Properties();
        try {
            is = clazz.getResourceAsStream(resourceName);
            ArgCheck.isNotNull(is);
            if (is != null) {
                   configProps.load(is);
            }
        } finally {
            if (is != null) {
                try {
                    is.close();
View Full Code Here

    // each hosts log entries.
    MDC.put("HOSTNAME", host);
    try {
      java.io.InputStream propertiesInputStream = servlet.getServletContext().getResourceAsStream("/WEB-INF/classes/CentraView.properties");
      if (propertiesInputStream != null) {
        inProps.load(propertiesInputStream);
      } else {
        throw new UnavailableException("Cannot create CentraView.properties InputStream.");
      }
      initCtx = new InitialContext(inProps);
    } catch (java.io.IOException e1) {
View Full Code Here

    FileInputStream fileStream = null;
    try {
      // _currentselection.clear();
      if (labelFile != null && labelFile.exists()) {
         fileStream = new FileInputStream(labelFile.getLocation().toFile());
        props.load(fileStream);
      }
    } catch (FileNotFoundException e) {
      Activator.getDefault().getLog().log(new Status(Status.ERROR, Activator.PLUGIN_ID, "Can't find propertyfile : " + labelFile.getLocation(), e));
    } catch (IOException e) {
      Activator.getDefault().getLog().log(new Status(Status.ERROR, Activator.PLUGIN_ID, "Can't read propertyfile : " + labelFile.getLocation(), e));
View Full Code Here

        Properties props = new Properties();
        InputStream in = null;
       
        try {
            in = Version.class.getClassLoader().getResourceAsStream("org/apache/ftpserver/ftpserver.properties");
            props.load(in);
            return props.getProperty("ftpserver.version");
        } catch (IOException e) {
            throw new RuntimeException("Failed to read version", e);
        } finally {
            IoUtils.close(in);
View Full Code Here

  private static Vector TOOLBARS = new Vector();

  public static void addToPluginBeanProps(File beanPropsFile) throws Exception {
    Properties tempP = new Properties();

    tempP.load(new FileInputStream(beanPropsFile));
    if (!BEAN_PLUGINS_PROPERTIES.contains(tempP)) {
      BEAN_PLUGINS_PROPERTIES.add(tempP);
    }
  }
View Full Code Here

             
              if ( zip_name.equals( "plugin.properties" ) || zip_name.endsWith( "/plugin.properties")){
               
                properties  = new Properties();
               
                properties.load( zis );
                               
              }else if ( zip_name.endsWith( ".jar" )){
               
                ZipInputStream  zis2 = new ZipInputStream( zis );
               
View Full Code Here

                 
                  if ( zip_name2.equals( "plugin.properties" )){
                   
                    properties  = new Properties();
                   
                    properties.load( zis2 );
     
                  }
                }
              }
            }
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.