Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.File;

import java.io.FileOutputStream;
import java.util.Properties;

public class Main {
    private static String CONFIG_FILE_PATH = "/mnt/sdcard/config.properties";

    /**
     * Save config file.
     */
    private static void saveConfig(Properties properties) {
        try {
            File file = new File(CONFIG_FILE_PATH);
            if (!file.exists())
                file.createNewFile();
            FileOutputStream s = new FileOutputStream(file);
            properties.store(s, "");
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
}