public void saveToFile(SubjectDataContainer container, Path file) throws IOException {
        MoreFiles.createDirectoriesIfNotExists(file.getParent());
        try (BufferedWriter writer = Files.newBufferedWriter(file, StandardCharsets.UTF_8)) {
            GsonProvider.prettyPrinting().toJson(container.serialize(), writer);
            writer.flush();
        }
    }
Saves subject data to a specific file

@param container the data
@param file the file
@throws IOException if the write fails
sponge/src/main/java/me/lucko/luckperms/sponge/service/model/persisted/SubjectStorage.java