Package java.util

Examples of java.util.Properties.store()


      }
      f=new File(dir,service.getId()+".service");
      try {
        StreamUtilities.outputStream(f, new OutputStreamProcessor() {
          public void process(OutputStream outputStream) throws IOException {
            prop.store(outputStream, "settings");
          }
        });
      } catch (IOException exc) {
        String msg = mLocalizer.msg("error.4", "Saving settings for plugin {0} failed!\n({1})",
            service.getInfo().getName(), f.getAbsolutePath(), exc);
View Full Code Here


        Connection conn = getConnection("functions");
        Statement stat = conn.createStatement();
        String fileName = getBaseDir() + "/test.txt";
        Properties prop = System.getProperties();
        OutputStream out = IOUtils.openFileOutputStream(fileName, false);
        prop.store(out, "");
        out.close();
        ResultSet rs = stat.executeQuery("SELECT LENGTH(FILE_READ('" + fileName + "')) LEN");
        rs.next();
        assertEquals(IOUtils.length(fileName), rs.getInt(1));
        rs = stat.executeQuery("SELECT FILE_READ('" + fileName + "') PROP");
View Full Code Here

   
   
    try {
      File f = new File("config.properties");
      f.createNewFile();
      p.store(new FileOutputStream(f), "Everbox4j Config");
      JOptionPane.showConfirmDialog(frmEverbox,
          "保存成功!! 如果你改变了用户名,请先退出客户端,然后再启动!","提醒",JOptionPane.OK_OPTION);
    } catch (Throwable e) {
      log.error("保存出错!!", e);
      JOptionPane.showConfirmDialog(frmEverbox, "保存失败!!!","警告",JOptionPane.OK_OPTION);
View Full Code Here

                    properties.put(key, headerText);        
                }               
                    
                {
                try {                                   
                    properties.store(new FileOutputStream(fileString), "Exported headers of project : " + _selectedProject.getName());
                }
                catch (FileNotFoundException e) {
                    MessageDialog.openError(getShell(), "Error", "WDS was unable to write file");
                    Plugin.getDefault().logError("WDS was unable to write file", e);
                }
View Full Code Here

    FileOutputStream fos = null;
    try {
      props.setProperty(TIME_KEY, String.valueOf(time.getTime()));
      props.setProperty("LAST_TIME", time.toString());
      fos = new FileOutputStream(realPath);
      props.store(fos, null);
    } finally {
      props = null;
      if (fos != null){
        fos.close();
        fos = null;
View Full Code Here

        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
    public void tearDown() {
View Full Code Here

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

        System.out.println("Writing password for " + args[1]);
        OutputStream os = new BufferedOutputStream( new FileOutputStream( userFile ) );
        users.store( os, "" );
        os.flush();
        os.close();
        System.out.println("done");
    }
View Full Code Here

       
        fos  = new FileOutputStream( new File( user_path, UPDATE_PROPERTIES ));
       
          // this handles unicode chars by writing \\u escapes
       
        update_properties.store(fos, "Azureus restart properties" );
       
      }catch( Throwable e ){
       
        Debug.printStackTrace( e );
       
View Full Code Here

                    } else {
                        logger.warn("The value enhancer is invalid, the value enhancer will be deleted.");
                       
                        properties.remove(key);
                        FileOutputStream fos = new FileOutputStream(filename);
                        properties.store(fos, "");
                        fos.close();
                    }
                }
            } catch (Exception e) {
                logger.error("Error while loading enhancer settings from " + filename, e);
View Full Code Here

            if (DataCrow.debug)
                properties.setProperty("log4j.rootLogger", "debug, textpane, logfile, stdout");
            else
                properties.setProperty("log4j.rootLogger", "info, textpane, logfile");
           
            properties.store(new FileOutputStream(DataCrow.installationDir + "log4j.properties"), "");
        } catch (Exception e) {
            logger.error("Could not find the log4j properties file.", e);
        }
       
        PropertyConfigurator.configure(DataCrow.installationDir + "log4j.properties");       
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.