mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
add comment
This commit is contained in:
parent
88edbafe4b
commit
b9699517a5
@ -223,9 +223,11 @@ public class FileUtil extends PathUtil {
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归遍历目录以及子目录中的所有文件
|
||||
* 递归遍历目录以及子目录中的所有文件<br>
|
||||
* 如果用户传入相对路径,则是相对classpath的路径<br>
|
||||
* 如:"test/aaa"表示"${classpath}/test/aaa"
|
||||
*
|
||||
* @param path 当前遍历文件或目录的路径
|
||||
* @param path 相对ClassPath的目录或者绝对路径目录
|
||||
* @return 文件列表
|
||||
* @since 3.2.0
|
||||
*/
|
||||
@ -245,7 +247,9 @@ public class FileUtil extends PathUtil {
|
||||
|
||||
/**
|
||||
* 获得指定目录下所有文件<br>
|
||||
* 不会扫描子目录
|
||||
* 不会扫描子目录<br>
|
||||
* 如果用户传入相对路径,则是相对classpath的路径<br>
|
||||
* 如:"test/aaa"表示"${classpath}/test/aaa"
|
||||
*
|
||||
* @param path 相对ClassPath的目录或者绝对路径目录
|
||||
* @return 文件路径列表(如果是jar中的文件,则给定类似.jar!/xxx/xxx的路径)
|
||||
@ -287,7 +291,7 @@ public class FileUtil extends PathUtil {
|
||||
/**
|
||||
* 创建File对象,相当于调用new File(),不做任何处理
|
||||
*
|
||||
* @param path 文件路径
|
||||
* @param path 文件路径,相对路径表示相对项目路径
|
||||
* @return File
|
||||
* @since 4.1.4
|
||||
*/
|
||||
@ -298,7 +302,7 @@ public class FileUtil extends PathUtil {
|
||||
/**
|
||||
* 创建File对象,自动识别相对或绝对路径,相对路径将自动从ClassPath下寻找
|
||||
*
|
||||
* @param path 文件路径
|
||||
* @param path 相对ClassPath的目录或者绝对路径目录
|
||||
* @return File
|
||||
*/
|
||||
public static File file(String path) {
|
||||
|
@ -298,6 +298,12 @@ public class FileUtilTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void loopFilesTest2() {
|
||||
FileUtil.loopFiles("").forEach(Console::log);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void loopFilesWithDepthTest() {
|
||||
|
Loading…
Reference in New Issue
Block a user