1
2
3
4
5
6
7 package org.mule.util;
8
9 import java.io.File;
10
11 public class FilenameUtils extends org.apache.commons.io.FilenameUtils
12 {
13 public static File fileWithPathComponents(String[] pathComponents)
14 {
15 if (pathComponents == null)
16 {
17 return null;
18 }
19
20 StringBuffer buf = new StringBuffer(64);
21 for (int i = 0; i < pathComponents.length; i++)
22 {
23 String component = pathComponents[i];
24 if (component == null)
25 {
26 continue;
27 }
28
29 buf.append(component);
30 if (i < pathComponents.length - 1)
31 {
32 buf.append(File.separator);
33 }
34 }
35 return FileUtils.newFile(buf.toString());
36 }
37
38
39
40
41 private FilenameUtils()
42 {
43 super();
44 }
45 }
46
47