Browse Source

增加标准化路径

10.0
richie 7 years ago
parent
commit
7c7749722d
  1. 11
      fine-commons-io/src/com/fr/third/org/apache/commons/io/FilenameUtils.java

11
fine-commons-io/src/com/fr/third/org/apache/commons/io/FilenameUtils.java

@ -195,6 +195,17 @@ public class FilenameUtils {
public static String normalize(final String filename) {
return doNormalize(filename, SYSTEM_SEPARATOR, true);
}
/**
* Normalizes a path with unix separator, removing double and single dot path steps.
* @param filename the filename to normalize, null returns null
* @return the normalized filename, or null if invalid. Null bytes inside string will be removed
*/
public static String standard(final String filename) {
return normalize(filename, true);
}
/**
* Normalizes a path, removing double and single dot path steps.
* <p>

Loading…
Cancel
Save