All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.blockwiseph.cftemplate.generator.CFTemplateFileSaver Maven / Gradle / Ivy

package org.blockwiseph.cftemplate.generator;

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.function.Consumer;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;

@AllArgsConstructor(access = AccessLevel.PACKAGE)
class CFTemplateFileSaver implements Consumer {

    private final String cfTemplateFilePath;

    @Override
    public void accept(String s) {
        try {
            Files.write(Paths.get(cfTemplateFilePath), s.getBytes(Charset.defaultCharset()));
        } catch (IOException e) {
            throw new RuntimeException("Unable to save yaml file");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy