package ru.job4j.chat;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

public class WriteToFile {
    private final File file;

    public WriteToFile(File file) {
        this.file = file;
    }

    public void appendString(String message) throws IOException {
        try (FileWriter writer = new FileWriter(file, true)) {
            writer.write(message);
        }
    }

    public String getPath() {
        return this.file.getPath();
    }
}
