Coverage Report - org.jbehave.core.io.rest.filesystem.FilesystemUtils
 
Classes in this File Line Coverage Branch Coverage Complexity
FilesystemUtils
80%
4/5
50%
1/2
1.333
 
 1  
 package org.jbehave.core.io.rest.filesystem;
 2  
 
 3  
 import static org.apache.commons.lang.StringUtils.substringBeforeLast;
 4  
 
 5  
 import java.io.File;
 6  
 
 7  
 import org.apache.commons.lang.StringUtils;
 8  
 import org.jbehave.core.io.rest.Resource;
 9  
 
 10  0
 public class FilesystemUtils {
 11  
 
 12  
         public static File asFile(Resource resource, String parentPath, String ext) {
 13  6
                 String childPath = ( resource.hasBreadcrumbs() ? StringUtils.join(resource.getBreadcrumbs(), "/")  : "" ) + "/" + resource.getName() + ext;
 14  6
                 return new File(parentPath, childPath);
 15  
         }
 16  
 
 17  
         public static String fileNameWithoutExt(File file) {
 18  14
                 return substringBeforeLast(file.getName(), ".");
 19  
         }
 20  
 
 21  
         public static String normalisedPathOf(File file) {
 22  14
                 return file.getPath().replace('\\','/');
 23  
         }
 24  
 
 25  
 }