mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add isDir
This commit is contained in:
@@ -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 文件名
|
||||
|
@@ -57,7 +57,11 @@ public class FileNameUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回文件名
|
||||
* 返回文件名<br>
|
||||
* <pre>
|
||||
* "d:/test/aaa" 返回 "aaa"
|
||||
* "/test/aaa.jpg" 返回 "aaa.jpg"
|
||||
* </pre>
|
||||
*
|
||||
* @param filePath 文件
|
||||
* @return 文件名
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user