From 7c7749722dd451176b89b646412486885d693dc5 Mon Sep 17 00:00:00 2001 From: richie Date: Sat, 14 Apr 2018 18:04:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A0=87=E5=87=86=E5=8C=96?= =?UTF-8?q?=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/third/org/apache/commons/io/FilenameUtils.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/fine-commons-io/src/com/fr/third/org/apache/commons/io/FilenameUtils.java b/fine-commons-io/src/com/fr/third/org/apache/commons/io/FilenameUtils.java index 73848113a..af41d632e 100644 --- a/fine-commons-io/src/com/fr/third/org/apache/commons/io/FilenameUtils.java +++ b/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. *