add comment

This commit is contained in:
Looly 2021-11-02 01:25:21 +08:00
parent 88edbafe4b
commit b9699517a5
2 changed files with 15 additions and 5 deletions

View File

@ -223,9 +223,11 @@ public class FileUtil extends PathUtil {
} }
/** /**
* 递归遍历目录以及子目录中的所有文件 * 递归遍历目录以及子目录中的所有文件<br>
* 如果用户传入相对路径则是相对classpath的路径<br>
* "test/aaa"表示"${classpath}/test/aaa"
* *
* @param path 当前遍历文件或目录的路径 * @param path 相对ClassPath的目录或者绝对路径目录
* @return 文件列表 * @return 文件列表
* @since 3.2.0 * @since 3.2.0
*/ */
@ -245,7 +247,9 @@ public class FileUtil extends PathUtil {
/** /**
* 获得指定目录下所有文件<br> * 获得指定目录下所有文件<br>
* 不会扫描子目录 * 不会扫描子目录<br>
* 如果用户传入相对路径则是相对classpath的路径<br>
* "test/aaa"表示"${classpath}/test/aaa"
* *
* @param path 相对ClassPath的目录或者绝对路径目录 * @param path 相对ClassPath的目录或者绝对路径目录
* @return 文件路径列表如果是jar中的文件则给定类似.jar!/xxx/xxx的路径 * @return 文件路径列表如果是jar中的文件则给定类似.jar!/xxx/xxx的路径
@ -287,7 +291,7 @@ public class FileUtil extends PathUtil {
/** /**
* 创建File对象相当于调用new File()不做任何处理 * 创建File对象相当于调用new File()不做任何处理
* *
* @param path 文件路径 * @param path 文件路径相对路径表示相对项目路径
* @return File * @return File
* @since 4.1.4 * @since 4.1.4
*/ */
@ -298,7 +302,7 @@ public class FileUtil extends PathUtil {
/** /**
* 创建File对象自动识别相对或绝对路径相对路径将自动从ClassPath下寻找 * 创建File对象自动识别相对或绝对路径相对路径将自动从ClassPath下寻找
* *
* @param path 文件路径 * @param path 相对ClassPath的目录或者绝对路径目录
* @return File * @return File
*/ */
public static File file(String path) { public static File file(String path) {

View File

@ -298,6 +298,12 @@ public class FileUtilTest {
} }
} }
@Test
@Ignore
public void loopFilesTest2() {
FileUtil.loopFiles("").forEach(Console::log);
}
@Test @Test
@Ignore @Ignore
public void loopFilesWithDepthTest() { public void loopFilesWithDepthTest() {