mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复FileUtil.isAbsolutePath没有判断smb路径问题(pr#1299@Gitee)
This commit is contained in:
@@ -57,26 +57,12 @@ public class FileUtilTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
public void smbPathTest() {
|
||||
String smbPath = "\\\\192.168.254.88\\share\\rc-source";
|
||||
String parseSmbPath = FileUtil.getAbsolutePath(smbPath);
|
||||
final String smbPath = "\\\\192.168.1.1\\share\\rc-source";
|
||||
final String parseSmbPath = FileUtil.getAbsolutePath(smbPath);
|
||||
assertEquals(smbPath, parseSmbPath);
|
||||
String dir = smbPath + "\\test";
|
||||
|
||||
FileUtil.mkdir(dir);
|
||||
assertTrue(FileUtil.exist(dir));
|
||||
String file = dir + "\\a.txt";
|
||||
FileUtil.touch(file);
|
||||
FileUtil.writeString("Hello SMB", file, "UTF-8");
|
||||
|
||||
String read = FileUtil.readString(file, "UTF-8");
|
||||
assertEquals(read, "Hello SMB");
|
||||
|
||||
assertEquals(1, FileUtil.loopFiles(dir).size());
|
||||
assertEquals(1, FileUtil.ls(dir).length);
|
||||
|
||||
FileUtil.del(dir);
|
||||
assertTrue(FileUtil.isAbsolutePath(smbPath));
|
||||
assertTrue(Paths.get(smbPath).isAbsolute());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user