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

ch.sbb.releasetrain.utils.workspace.ClasspathToWorkspaceWriterImpl Maven / Gradle / Ivy

package ch.sbb.releasetrain.utils.workspace;

import lombok.Setter;
import ch.sbb.releasetrain.utils.file.FileUtil;

import com.google.inject.Inject;

/**
 * Util to write Files from classpath to the workspace (ex. jenkins workspace)
 *
 * @author u203244 (Daniel Marthaler)
 * @since 0.0.1, 2016
 */
public class ClasspathToWorkspaceWriterImpl implements ClasspathToWorkspaceWriter {

    @Setter
    protected String workspace;

    @Inject
    protected FileUtil fileUtil;

    @Override
    public void writeFileFromCPToWorkspace(String folder, String filename) {
        String content = fileUtil.readFileToStringFromClasspath("/" + folder + "/" + filename);
        fileUtil.writeFile(workspace + "/" + filename, content);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy