Added SystemFilesFilter
This commit is contained in:
parent
cfd862c057
commit
2a039350e4
|
@ -72,6 +72,10 @@ public class MediaDetection {
|
|||
|
||||
public static final ReleaseInfo releaseInfo = new ReleaseInfo();
|
||||
|
||||
public static FileFilter getSystemFilesFilter() {
|
||||
return releaseInfo.getSystemFilesFilter();
|
||||
}
|
||||
|
||||
public static FileFilter getDiskFolderFilter() {
|
||||
return releaseInfo.getDiskFolderFilter();
|
||||
}
|
||||
|
|
|
@ -400,6 +400,15 @@ public class ReleaseInfo {
|
|||
return clutterFileFilter;
|
||||
}
|
||||
|
||||
private static RegexFileFilter systemFilesFilter;
|
||||
|
||||
public FileFilter getSystemFilesFilter() {
|
||||
if (systemFilesFilter == null) {
|
||||
systemFilesFilter = new RegexFileFilter(compile(getProperty("pattern.system.files"), CASE_INSENSITIVE));
|
||||
}
|
||||
return systemFilesFilter;
|
||||
}
|
||||
|
||||
public List<File> getMediaRoots() {
|
||||
String roots = getProperty("folder.media.roots");
|
||||
return COMMA.splitAsStream(roots).map(File::new).collect(toList());
|
||||
|
|
|
@ -45,3 +45,6 @@ pattern.diskfolder.entry: BDMV|HVDVD_TS|VIDEO_TS|AUDIO_TS|VCD|MovieObject.bdmv|V
|
|||
|
||||
# media root folders
|
||||
folder.media.roots: /Volumes:/Users:/home:/mnt:/media
|
||||
|
||||
# system file pattern
|
||||
pattern.system.files: [.@].+|bin|initrd|opt|sbin|var|dev|lib|proc|sys|var.defaults|etc|lost.found|root|tmp|etc.defaults|mnt|run|usr|System.Volume.Information
|
||||
|
|
|
@ -764,7 +764,7 @@ public final class FileUtilities {
|
|||
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
return pattern.matcher(name).find();
|
||||
return pattern.matcher(name).matches();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue