import java.io.*; import java.util.Scanner; public class Storage implements StorageInterface { @Override public void export() { } @Override public void load() { } public boolean writeFile(String path, String content) { if (!path.isEmpty() && !content.isEmpty()) { try { BufferedWriter writer = new BufferedWriter(new FileWriter(path, false)); writer.append(content); writer.close(); } catch (IOException e) { e.printStackTrace(); return false; } return true; } return false; } public String readFile(String path) { if (!path.isEmpty()) { StringBuilder data = new StringBuilder(); try { File f = new File(path); Scanner myReader = new Scanner(f); while (myReader.hasNextLine()) { data.append(myReader.nextLine()); } myReader.close(); } catch (FileNotFoundException e) { e.printStackTrace(); return null; } return data.toString(); } return null; } }