Coverage Report - org.mule.util.FilenameUtils
 
Classes in this File Line Coverage Branch Coverage Complexity
FilenameUtils
85%
11/13
100%
8/8
3.5
 
 1  
 /*
 2  
  * $Id: FilenameUtils.java 8077 2007-08-27 20:15:25Z aperepel $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 9  
  */
 10  
 
 11  
 package org.mule.util;
 12  
 
 13  
 import java.io.File;
 14  
 
 15  
 public class FilenameUtils extends org.apache.commons.io.FilenameUtils
 16  
 {
 17  
     public static File fileWithPathComponents(String[] pathComponents)
 18  
     {
 19  6
         if (pathComponents == null)
 20  
         {
 21  2
             return null;
 22  
         }
 23  
         
 24  4
         StringBuffer buf = new StringBuffer(64);
 25  20
         for (int i = 0; i < pathComponents.length; i++)
 26  
         {
 27  16
             String component = pathComponents[i];
 28  16
             if (component == null)
 29  
             {
 30  2
                 continue;
 31  
             }
 32  
             
 33  14
             buf.append(component);
 34  14
             if (i < pathComponents.length - 1)
 35  
             {
 36  10
                 buf.append(File.separator);
 37  
             }
 38  
         }
 39  4
         return FileUtils.newFile(buf.toString());
 40  
     }
 41  
     
 42  
     /**
 43  
      * Never create instances of this class.
 44  
      */
 45  
     private FilenameUtils()
 46  
     {
 47  0
         super();
 48  0
     }
 49  
 }
 50  
 
 51