|
@@ -299,7 +299,9 @@ public class FileUtils { |
|
|
* @param file the "reference" file for relative paths. This |
|
|
* @param file the "reference" file for relative paths. This |
|
|
* instance must be an absolute file and must not contain |
|
|
* instance must be an absolute file and must not contain |
|
|
* "./" or "../" sequences (same for \ instead |
|
|
* "./" or "../" sequences (same for \ instead |
|
|
* of /). |
|
|
|
|
|
|
|
|
* of /). If it is null, this call is equivalent to |
|
|
|
|
|
* <code>new java.io.File(filename)</code>. |
|
|
|
|
|
* |
|
|
* @param filename a file name |
|
|
* @param filename a file name |
|
|
* |
|
|
* |
|
|
* @return an absolute file that doesn't contain "./" or |
|
|
* @return an absolute file that doesn't contain "./" or |
|
@@ -327,6 +329,10 @@ public class FileUtils { |
|
|
return normalize(filename); |
|
|
return normalize(filename); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (file == null) { |
|
|
|
|
|
return new File(filename); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
File helpFile = new File(file.getAbsolutePath()); |
|
|
File helpFile = new File(file.getAbsolutePath()); |
|
|
StringTokenizer tok = new StringTokenizer(filename, File.separator); |
|
|
StringTokenizer tok = new StringTokenizer(filename, File.separator); |
|
|
while (tok.hasMoreTokens()) { |
|
|
while (tok.hasMoreTokens()) { |
|
@@ -361,6 +367,9 @@ public class FileUtils { |
|
|
* <li>DOS style paths that start with a drive letter will have |
|
|
* <li>DOS style paths that start with a drive letter will have |
|
|
* \ as the separator.</li> |
|
|
* \ as the separator.</li> |
|
|
* </ul> |
|
|
* </ul> |
|
|
|
|
|
* |
|
|
|
|
|
* @throws java.lang.NullPointerException if the file path is |
|
|
|
|
|
* equal to null. |
|
|
*/ |
|
|
*/ |
|
|
public File normalize(String path) { |
|
|
public File normalize(String path) { |
|
|
String orig = path; |
|
|
String orig = path; |
|
|