Here you can find the source of saveFile(String[] lines, String savedName, String extension)
public static void saveFile(String[] lines, String savedName, String extension) throws Exception
//package com.java2s; //License from project: Open Source License import java.io.FileWriter; public class Main { public static void saveFile(String[] lines, String savedName) throws Exception { FileWriter fw = new FileWriter("src/main/java/es/uniovi/asw/data/" + savedName + ".JSON"); for (int i = 0; i < lines.length; i++) { fw.write(lines[i] + "\n"); }// ww w . java2 s . c o m fw.close(); } public static void saveFile(String[] lines, String savedName, String extension) throws Exception { FileWriter fw = new FileWriter("src/main/java/es/uniovi/asw/data/" + savedName + "." + extension); for (int i = 0; i < lines.length; i++) { fw.write(lines[i] + "\n"); } fw.close(); } }