net.serenitybdd.jbehave.UTF8StoryLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of serenity-jbehave Show documentation
Show all versions of serenity-jbehave Show documentation
Serenity JBehave integration
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