Package java.util

Examples of java.util.Properties.load()


    File f=new File(Settings.getUserSettingsDirName(),service.getId()+".service");
    if (f.exists()) {
      try {
        Properties p=new Properties();
        BufferedInputStream in = new BufferedInputStream(new FileInputStream(f), 0x1000);
        p.load(in);
        in.close();
        service.loadSettings(p);
      } catch (IOException exc) {
        String msg = mLocalizer.msg("error.3", "Loading settings for plugin {0} failed!\n({1})",
            service.getInfo().getName(), f.getAbsolutePath(), exc);
View Full Code Here


                              FileMonitoringTimerTask.DEFAULT_MONITORING_CONFIG_PERIOD).longValue();
        String results = getProperty(FileMonitoringTimerTask.MONITORING_RESULT_PATH_PROPERTY,
                                     FileMonitoringTimerTask.DEFAULT_MONITORING_RESULT_PATH);
       
        Properties monitoringProps = new Properties();
        monitoringProps.load(new FileInputStream(file));
       
        fileMonitoringTimerTask = new FileMonitoringTimerTask(getTimer(), period, monitoringProps, results);
        if (fileMonitoringTimerTask != null) {
          try {
            MXWrapper.registerMBean(fileMonitoringTimerTask,
View Full Code Here

                                  LogMonitoringTimerTask.DEFAULT_MONITORING_RESULT_LEVEL).intValue();
        String logmsg = getProperty(LogMonitoringTimerTask.MONITORING_RESULT_MESSAGE_PROPERTY,
                                    LogMonitoringTimerTask.DEFAULT_MONITORING_RESULT_MESSAGE);
       
        Properties monitoringProps = new Properties();
        monitoringProps.load(new FileInputStream(file));
       
        logMonitoringTimerTask = new LogMonitoringTimerTask(getTimer(), period, monitoringProps,
                                                            logger, logmsg, loglevel);

        if (logMonitoringTimerTask != null) {
View Full Code Here

    Properties readProps(String fileName) throws IOException
    {
        Properties props;
        FileInputStream _stream = new FileInputStream(fileName);
        props=new Properties();
        props.load(_stream);
        return props;
    }

    private static volatile PersistenceManager _manager = null;
    private static volatile PersistenceFactory _factory = null;
View Full Code Here

      Cipher cipher = Cipher.getInstance("Blowfish/CBC/PKCS5Padding");
      cipher.init(Cipher.DECRYPT_MODE, blowfishKey, ivSpec);

      ByteArrayInputStream byteArrayInStream = new ByteArrayInputStream(cipher.doFinal(licenseFile));
      returnProperties = new Properties();
      returnProperties.load(byteArrayInStream);
    } catch (Exception exception) {
      logger.error("decryptLicenseFile: generic Exception", exception);
    }
    return returnProperties;
  } //end of decryptLicenseFile method
View Full Code Here

            Properties props = new Properties();
            stream = ProtocolDirectory.class.getResourceAsStream(path);
            if (stream == null) {
                throw new RuntimeException("Unable to load required properties file '" + path + '\'');
            }
            props.load(stream);

            for (Iterator iter = props.keySet().iterator(); iter.hasNext();) {
                String name = (String) iter.next();
                String objectName = props.getProperty(name);
                Protocol inst = loadProtocol(objectName);
View Full Code Here

    Properties properties = new Properties();
    InputStream stream = ConfigUtils.class.getResourceAsStream(resourceName);

    try
    {
      properties.load(stream);
    }
    catch (IOException e)
    {
      log.warn("No " + resourceName + " found on classpath. Using default settings.");
    }
View Full Code Here

        new CheckI18N().start();
    }

    public void start() throws IOException {
        Properties english = new Properties();
        english.load(getClass().getResourceAsStream("messages.properties"));

        Properties de = new Properties();
        de.load(getClass().getResourceAsStream("messages_de.properties"));

View Full Code Here

    public void start() throws IOException {
        Properties english = new Properties();
        english.load(getClass().getResourceAsStream("messages.properties"));

        Properties de = new Properties();
        de.load(getClass().getResourceAsStream("messages_de.properties"));


//        Map<String, String> englishMap = FastMap.newInstance();
        Set<String> deKeys = FastSet.newInstance();
        Map<String, String> missingInDE = new TreeMap();
View Full Code Here

        rs.next();
        assertEquals(IOUtils.length(fileName), rs.getInt(1));
        rs = stat.executeQuery("SELECT FILE_READ('" + fileName + "') PROP");
        rs.next();
        Properties p2 = new Properties();
        p2.load(rs.getBinaryStream(1));
        assertEquals(prop.size(), p2.size());
        rs = stat.executeQuery("SELECT FILE_READ('" + fileName + "', NULL) PROP");
        rs.next();
        String ps = rs.getString(1);
        InputStreamReader r = new InputStreamReader(IOUtils.openFileInputStream(fileName));
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.