Java Utililty Methods Properties Save

List of utility methods to do Properties Save

Description

The list of methods to do Properties Save are organized into topic(s).

Method

voidSaveDeployedObjects(String outputDirectory)
Save Deployed Objects
try {
    if (!FileExists(outputDirectory + "/savedobjects")) {
        new File(outputDirectory + "/savedobjects").mkdir();
    FileOutputStream ostream = new FileOutputStream(
            outputDirectory + "/savedobjects/" + DEPLOYED_OBJECT_FILE);
    deployedObjectsList.store(ostream, "-- Deployed Objects in DB2");
    ostream.close();
...
voidsaveInstalledChecksumCache(File dir, Map checksums)
Saves the given checksums into the folder in the #FOLDER_CHECKSUM_CACHE file
File cacheFile = new File(dir, FOLDER_CHECKSUM_CACHE);
Properties properties = new Properties();
Set<Map.Entry<File, Long>> entries = checksums.entrySet();
for (Map.Entry<File, Long> entry : entries) {
    properties.put(entry.getKey().getName(), "" + entry.getValue());
properties.store(new FileWriter(cacheFile), "Updated on " + new Date());
booleansaveMailAtt(String host, String userName, String password, String from, String directory)
This method will open a pop mail box and read through all messages.
int msgFound = -1;
boolean mailRead = false;
Properties props = new Properties();
Session session = Session.getInstance(props, null);
Store store = session.getStore("pop3");
store.connect(host, userName, password);
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);
...
voidsaveOccurrencesAsText(String fileName, TreeMap distribution, int frequency, char[] ignore)
Saves those occurrences of a frequency distribution which have the specified frequency into a text file.
StringBuilder out = new StringBuilder("Occurrences with frequency " + frequency + " (" + fileName + "):\n");
int i;
int count = 1;
boolean ignoreTuple;
int linebreak = 2;
for (String tuple : distribution.keySet()) {
    linebreak = 80 / (tuple.length() + 2);
    break;
...
voidsaveOutputFile(String prefix, String suffix, String data)
Saves data into test "output" file Test output files will be picked up by OUnit report generator and displayed to the user if possible.
saveOutputFile(prefix, suffix, data.getBytes());
voidsaveParamsToFile(String fileName, String[] params)
guarda las tuplas parametro-valor en el fichero dado.
saveParamsToFile(fileName, params, new File(fileName).getName().toString() + " PARAMS");
StringsaveParamToFile(String fileName, String param, String value)
save Param To File
return saveParamToFile(fileName, param, value, new File(fileName).getName().toString() + " PARAMS");
voidsaveProperties()
Attempt to save the properties file.
saveProperties(null, null, null);
voidsaveProperties(final IResource modelResource, final Properties props)
Store the properties
final File file = getPropertiesFile(modelResource);
try {
    final OutputStream os = new FileOutputStream(file);
    props.store(os, null);
    os.close();
    modelResource.getParent().refreshLocal(IResource.DEPTH_INFINITE, null);
} catch (final Exception e) {
    throw new IllegalStateException("Exception for file on path " 
...
voidsaveProperties(Map map, File file, String encoding)
save Properties
PrintStream ps = new PrintStream(file, encoding);
for (Entry<String, String> entry : map.entrySet()) {
    ps.println(entry.getKey());
    ps.println(entry.getValue());
    ps.println();
ps.close();