Added SystemFilesFilter

This commit is contained in:
Reinhard Pointner 2016-04-05 18:05:44 +00:00
parent cfd862c057
commit 2a039350e4
4 changed files with 17 additions and 1 deletions

View File

@ -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();
}

View File

@ -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());

View File

@ -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

View File

@ -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