fix 扫描音乐文件夹内部无法处理含有+号的目录
This commit is contained in:
parent
4ffd94e3d1
commit
d8acadf2d7
@ -114,11 +114,12 @@ public class MusicToolsServiceImpl implements IMusicToolsService {
|
|||||||
MusicDataExample example = new MusicDataExample();
|
MusicDataExample example = new MusicDataExample();
|
||||||
String replacement = "windows".equals(ConfigTools.load(ConfigTools.CONFIG, "os")) ? "\\\\" : "/";
|
String replacement = "windows".equals(ConfigTools.load(ConfigTools.CONFIG, "os")) ? "\\\\" : "/";
|
||||||
String tmpPath = path;
|
String tmpPath = path;
|
||||||
if (new File(path).isDirectory()) {
|
if (isDir) {
|
||||||
example.createCriteria().andFileLike(tmpPath.replace(File.separator, replacement) + "%");
|
example.createCriteria().andFileLike(tmpPath.replace(File.separator, replacement) + "%");
|
||||||
main = musicDataDao.selectByExample(example);
|
main = musicDataDao.selectByExample(example);
|
||||||
}
|
}
|
||||||
tmpPath = tmpPath.replace(File.separator, replacement)
|
tmpPath = tmpPath.replace(File.separator, replacement)
|
||||||
|
.replace("+", "\\+")
|
||||||
.replace("[", "\\[")
|
.replace("[", "\\[")
|
||||||
.replace("(", "\\(")
|
.replace("(", "\\(")
|
||||||
.replace(")", "\\)")
|
.replace(")", "\\)")
|
||||||
|
Loading…
Reference in New Issue
Block a user