Java tutorial
//package com.java2s; //License from project: Open Source License import java.io.FileWriter; import java.io.IOException; public class Main { /** * This method writes a security token file * * @param tokenFilePath * - path of the security token * @param token * - security token * @return true == succeed, false == failed */ private static boolean writeTokenFile(String tokenFilePath, String token) { try { FileWriter file = new FileWriter(tokenFilePath); file.write(token); file.close(); } catch (IOException e) { return false; } return true; } }