1
2
3
4
5
6
7
8
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 if (pathComponents == null)
20 {
21 return null;
22 }
23
24 StringBuffer buf = new StringBuffer(64);
25 for (int i = 0; i < pathComponents.length; i++)
26 {
27 String component = pathComponents[i];
28 if (component == null)
29 {
30 continue;
31 }
32
33 buf.append(component);
34 if (i < pathComponents.length - 1)
35 {
36 buf.append(File.separator);
37 }
38 }
39 return FileUtils.newFile(buf.toString());
40 }
41
42
43
44
45 private FilenameUtils()
46 {
47 super();
48 }
49 }
50
51