public void writeToFile(List<Entry> entryList) {
        Path file = Paths.get(mPath + "/database-1psw.csv");
        try {
            Files.deleteIfExists(file);
            Files.createDirectories(Paths.get(mPath));
            file = Files.createFile(file);
        } catch (IOException e) {
            System.err.println("Error creating file");
        }

        try (BufferedWriter writer = Files.newBufferedWriter(file, Charset.forName("UTF-8"))) {
            for (Entry entry : entryList) {
                writer.append(entry.toString());
                writer.newLine();
            }
            writer.flush();
        } catch (IOException e) {
            System.err.println("Error writing to file");
        }
    }