Add property to include/exclude files by pattern

This commit is contained in:
2022-04-11 23:26:34 +02:00
parent f9a7bd1af6
commit c2f32a30ce
5 changed files with 33 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
package at.pcgamingfreaks.mkvaudiosubtitlechanger.impl;
import at.pcgamingfreaks.mkvaudiosubtitlechanger.config.Config;
import lombok.extern.log4j.Log4j2;
import java.io.File;
@@ -28,6 +29,7 @@ public class MkvFileCollector implements FileCollector {
.filter(Files::isRegularFile)
.map(Path::toFile)
.filter(f -> f.getAbsolutePath().endsWith(".mkv"))
.filter(f -> Config.getInstance().getIncludePattern().matcher(f.getName()).matches())
.collect(Collectors.toList());
} catch (IOException e) {
log.error("Couldn't find file or directory!", e);