Coverage Report - org.jbehave.core.io.LoadFromURL
 
Classes in this File Line Coverage Branch Coverage Complexity
LoadFromURL
100%
5/5
N/A
4
 
 1  
 package org.jbehave.core.io;
 2  
 
 3  
 import java.net.URL;
 4  
 
 5  
 import org.apache.commons.io.IOUtils;
 6  
 
 7  
 /**
 8  
  * Loads story content from URLs
 9  
  */
 10  2
 public class LoadFromURL implements StoryLoader {
 11  
     public String loadStoryAsText(String storyPath) {
 12  
         try {
 13  2
             URL url = new URL(storyPath);
 14  2
             return IOUtils.toString(url.openStream());
 15  1
         } catch (Exception e) {
 16  1
             throw new InvalidStoryResource(storyPath, e);
 17  
         }
 18  
     }
 19  
 
 20  
 }