Package java.util

Examples of java.util.Properties.store()


          }

          System.exit(1);
        }

        prop.store(new FileOutputStream(file), "");
      } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (IOException e) {
        // TODO Auto-generated catch block
View Full Code Here


        try {
            OutputStream stream = new FileOutputStream(file);
            Properties def = new Properties();
            def.setProperty("defaultProfile", profile);
            def.store(stream, "default profile setting");
            stream.close();
        } catch (Exception e) {
            com.valhalla.Logger.logException(e);
        }
    }
View Full Code Here

        props.put("translator.failed", String.valueOf(HtmlToRenderSnakeTranslator.TRANSLATIONS_FAILED));
        props.put("translator.linecount", String.valueOf(HtmlToRenderSnakeTranslator.TRANSLATIONS_LINECOUNT));
        props.put("translator.ok", String.valueOf(HtmlToRenderSnakeTranslator.TRANSLATIONS_OK));
        try {
            FileWriter fw = new FileWriter("/tmp/rendersnake.properties");
            props.store(new FileWriter("/tmp/rendersnake.properties"), "nothing to say");
            fw.close();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

                                            
  public void write(OutputStream os) throws IOException
  {
    final Properties p = toProperties();
   
    p.store(os, "FMJ registry");
   
  }
 
  private Properties toProperties()
  {
View Full Code Here

      // create necessary directories
      File directory = newPropertiesFile.getParentFile();
      if (!directory.exists()) directory.mkdirs();
      // write to file file now
      fileStream = new FileOutputStream(newPropertiesFile);
      newProperties.store(fileStream, null);
      fileStream.flush();
    } catch (FileNotFoundException e) {
      throw new OLATRuntimeException("Could not create new language file::" + newPropertiesFile.getAbsolutePath(), e);
    } catch (IOException e) {
      throw new OLATRuntimeException("Could not create new language file::" + newPropertiesFile.getAbsolutePath()
View Full Code Here

          // Create jar entry for this path, name and last modified
          JarEntry jarEntry = new JarEntry(entryFileName);
          jarEntry.setTime(now);
          // Write properties to jar file
          out.putNextEntry(jarEntry);
          propertyFile.store(out, null);
          if (isLogDebugEnabled()) {
            logDebug("Adding file::" + entryFileName + " + to jar", null);
          }
        }
      }
View Full Code Here

      ZipEntry propsEntry = new ZipEntry("jasperreports_extension.properties");
      zipos.putNextEntry(propsEntry);
      Properties props = new Properties();
      props.put(PROPERTY_XML_CHART_THEME_REGISTRY_FACTORY, XmlChartThemeExtensionsRegistryFactory.class.getName());
      props.put(XML_CHART_THEME_PROPERTY_PREFIX + themeName, themeName + ".jrctx");
      props.store(zipos, null);

      ZipEntry jrctxEntry = new ZipEntry(themeName + ".jrctx");
      zipos.putNextEntry(jrctxEntry);
      XmlChartTheme.saveSettings(settings, new OutputStreamWriter(zipos));
View Full Code Here

                for (int i = 0; i < c.length; i++) {
                    versions.put(c[i], p.get(c[i], ""));
                }
                FileOutputStream fos = new FileOutputStream(versionsFile);
                try {
                    versions.store(fos, "Database versions");
                } finally {
                    Util.closeStream(fos);
                }
                p.removeNode();
            }
View Full Code Here

                }
            }
        } finally {
            FileOutputStream fos = new FileOutputStream(versionsFile);
            try {
                versions.store(fos, "Database versions");
            } finally {
                Util.closeStream(fos);
            }
        }
    }
View Full Code Here

    // update modification time
    if (!page.getContent().equals("")) page.setModificationTime(System.currentTimeMillis());
    Properties p = getPageProperties(page);
    try {
      OutputStream os = leaf.getOutputStream(false);
      p.store(os, "wiki page meta properties");
      os.close();
      // if (incrementVersion) page.incrementVersion();
    } catch (IOException e) {
      throw new OLATRuntimeException(WikiManager.class, "failed to save wiki page properties for page with id: " + page.getPageId() + " and olatresource: " + ores.getResourceableId(), 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.