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

uk.co.mruoc.properties.Base64FileContentLoader Maven / Gradle / Ivy

Go to download

Code library to easily load files and file from the classpath or file system file

There is a newer version: 7.0.4
Show newest version
package uk.co.mruoc.properties;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Base64FileContentLoader implements FileContentLoader {

    private static final Logger LOGGER = LoggerFactory.getLogger(Base64FileContentLoader.class);

    private final Base64Encoder base64Encoder = new Base64Encoder();
    private final FileContentLoader contentLoader;

    public Base64FileContentLoader(FileContentLoader contentLoader) {
        this.contentLoader = contentLoader;
    }

    @Override
    public String loadContent(String path) {
        String content = contentLoader.loadContent(path);
        String base64 = base64Encoder.encode(content);
        LOGGER.info("converted content " + content + " into base64 " + base64);
        return base64;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy