!152 文件夹含有正则符号重命名子级filePath异常修复
Merge pull request !152 from xiao/develop
This commit is contained in:
commit
746ec5cf65
@ -55,6 +55,7 @@ import java.net.URLDecoder;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@ -262,7 +263,8 @@ public class FileController {
|
||||
List<UserFile> list = userFileService.selectUserFileByLikeRightFilePath(new QiwenFile(userFile.getFilePath(), userFile.getFileName(), true).getPath(), sessionUserBean.getUserId());
|
||||
|
||||
for (UserFile newUserFile : list) {
|
||||
newUserFile.setFilePath(newUserFile.getFilePath().replaceFirst(new QiwenFile(userFile.getFilePath(), userFile.getFileName(), userFile.getIsDir() == 1).getPath(),
|
||||
String escapedPattern = Pattern.quote(new QiwenFile(userFile.getFilePath(), userFile.getFileName(), userFile.getIsDir() == 1).getPath());
|
||||
newUserFile.setFilePath(newUserFile.getFilePath().replaceFirst(escapedPattern,
|
||||
new QiwenFile(userFile.getFilePath(), renameFileDto.getFileName(), userFile.getIsDir() == 1).getPath()));
|
||||
userFileService.updateById(newUserFile);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user