Java Properties Save saveDefaultScriptDirectory(String path)

Here you can find the source of saveDefaultScriptDirectory(String path)

Description

save Default Script Directory

License

Open Source License

Declaration

public static void saveDefaultScriptDirectory(String path) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

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

import java.io.OutputStream;
import java.util.Properties;

public class Main {
    private static final String DEFAULT_SCRIPT_DIR = "default_script_directory";
    private static String filePath;
    private static Properties config;

    public static void saveDefaultScriptDirectory(String path) {
        config.setProperty(DEFAULT_SCRIPT_DIR, path);
        store();//w  ww  .ja  v  a  2 s . c  o m
    }

    private static void store() {
        OutputStream stream = null;
        try {
            stream = new FileOutputStream(filePath);
            config.store(stream, null);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (stream != null) {
                try {
                    stream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

Related

  1. save(Properties props, File file, String comment)
  2. save(String fileName, CharSequence string)
  3. saveBuildConfiguration(IFile ifile)
  4. saveConfig()
  5. saveConfig(File settingsFile, Properties properties)
  6. SaveDeployedObjects(String outputDirectory)
  7. saveInstalledChecksumCache(File dir, Map checksums)
  8. saveMailAtt(String host, String userName, String password, String from, String directory)
  9. saveOccurrencesAsText(String fileName, TreeMap distribution, int frequency, char[] ignore)