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