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

net.serenitybdd.jbehave.UTF8StoryLoader Maven / Gradle / Ivy

There is a newer version: 1.46.0
Show newest version
package net.serenitybdd.jbehave;

import org.apache.commons.io.IOUtils;
import org.jbehave.core.io.InvalidStoryResource;
import org.jbehave.core.io.LoadFromClasspath;

import java.io.IOException;
import java.io.InputStream;

public class UTF8StoryLoader extends LoadFromClasspath {

	public String loadResourceAsText(String resourcePath) {
        InputStream stream = resourceAsStream(resourcePath);
		try {
			return IOUtils.toString(stream, "UTF-8");
		} catch (IOException e) {
			throw new InvalidStoryResource(resourcePath, stream, e);
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy