Java Properties Save saveSysDirProperties(Properties sysProps, String classpathDirectory)

Here you can find the source of saveSysDirProperties(Properties sysProps, String classpathDirectory)

Description

save Sys Dir Properties

License

Contributor Agreement License

Declaration

public static void saveSysDirProperties(Properties sysProps, String classpathDirectory) 

Method Source Code


//package com.java2s;
/*//  w  ww.  j a v a2  s  .c o m
 *
 *
 * Copyright (C) 2007 Pingtel Corp., certain elements licensed under a Contributor Agreement.
 * Contributors retain copyright to elements licensed under a Contributor Agreement.
 * Licensed to the User under the LGPL license.
 *
 *
 */

import java.io.File;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

import java.util.Properties;

public class Main {
    public static void saveSysDirProperties(Properties sysProps, String classpathDirectory) {
        File sysdirPropsFile = new File(classpathDirectory, "sipxconfig.properties");
        FileOutputStream sysdirPropsStream;
        try {
            sysdirPropsStream = new FileOutputStream(sysdirPropsFile);
            // store them so spring's application context file find it
            // in classpath
            sysProps.store(sysdirPropsStream, null);
        } catch (FileNotFoundException e) {
            throw new RuntimeException("could not create system dir properties file", e);
        } catch (IOException e) {
            throw new RuntimeException("could not store system dir properties", e);
        }
    }
}

Related

  1. saveProperty(String key, String value)
  2. saveProperty(String key, String value)
  3. saveProps(Properties p, String fname, String comment)
  4. saveProps(String path, Properties props)
  5. saveSorted(Properties props, File file)
  6. saveToFile(Properties prop, String fileName)
  7. saveUserSettings(Properties properties)
  8. serialize(Properties properties)
  9. serialize(Properties props)