add isDir

This commit is contained in:
Looly
2021-07-18 22:10:46 +08:00
parent 0915b8918d
commit a081f999b5
7 changed files with 52 additions and 15 deletions

View File

@@ -1479,9 +1479,9 @@ public class FileUtil extends PathUtil {
}
// issue#1703@Github
if(tops > 0 && StrUtil.isEmpty(prefix)){
if (tops > 0 && StrUtil.isEmpty(prefix)) {
// 只有相对路径补充开头的..,绝对路径直接忽略之
while (tops-- > 0){
while (tops-- > 0) {
//遍历完节点发现还有上级标注(即开头有一个或多个..),补充之
// Normal path element found.
pathElements.add(0, StrUtil.DOUBLE_DOT);
@@ -1555,7 +1555,11 @@ public class FileUtil extends PathUtil {
}
/**
* 返回文件名
* 返回文件名<br>
* <pre>
* "d:/test/aaa" 返回 "aaa"
* "/test/aaa.jpg" 返回 "aaa.jpg"
* </pre>
*
* @param filePath 文件
* @return 文件名

View File

@@ -57,7 +57,11 @@ public class FileNameUtil {
}
/**
* 返回文件名
* 返回文件名<br>
* <pre>
* "d:/test/aaa" 返回 "aaa"
* "/test/aaa.jpg" 返回 "aaa.jpg"
* </pre>
*
* @param filePath 文件
* @return 文件名

View File

@@ -2163,7 +2163,8 @@ public class NumberUtil {
} catch (Exception ignore) {
// 忽略解析错误
}
return StrUtil.isBlank(number) ? BigDecimal.ZERO : new BigDecimal(number);
return StrUtil.isBlank(number) ? BigDecimal.ZERO : new
BigDecimal(number);
}
/**