public static boolean setContentToFile(File file, String content) {
boolean bool = false;
BufferedOutputStream output = null;
try {
output = new BufferedOutputStream(new FileOutputStream(file));
output.write(content.getBytes("UTF-8"));
bool = true;
} catch (Exception e) {
bool = false;
e.printStackTrace();
} finally {
if (output != null) {
try {
output.close();
output = null;
} catch (IOException e) {
}
}
}
return bool;
}