/** * Factory method that creates an instance of this class from a set of minimal patterns to be respected, * and also a set of exclusion patterns. * * @param minimalPatterns The set of patterns to be checked. * @param notAcceptedPatterns The set of exclusion patterns to be checked. Pass <code>null</code> if you * do not want to have such a check. * @return A new <code>ProductContentEnforcer</code> instance. */ public static ProductContentEnforcer create(String[] minimalPatterns, String[] notAcceptedPatterns) { return new ProductContentEnforcer(minimalPatterns, notAcceptedPatterns); }
if (enforcer.isConsistent(files)) { retVal = DecodeQualification.INTENDED; Pattern[] patternList = enforcer.getMinimalFilePatternList(); File inputFile = getFileInput(input); if (inputFile.isFile() && virtualDir.setFolderDepth(folderDepth); files = virtualDir.listAll(patternList); if (files.length >= patternList.length && enforcer.isConsistent(files)) { retVal = DecodeQualification.INTENDED;
@Override public boolean accept(File file) { boolean shouldAccept = super.accept(file); if (shouldAccept && file.isFile() && !VirtualDirEx.isPackedFile(file)) { File folder = file.getParentFile(); if (!processed.containsKey(folder)) { try { List<String> files = listFiles(folder, depth); shouldAccept = enforcer.isConsistent(files); processed.put(folder, shouldAccept); } catch (IOException e) { Logger.getLogger(BaseProductFileFilter.class.getName()).warning(e.getMessage()); } } else { shouldAccept = processed.get(folder); } } return shouldAccept; }
this.folderDepth = Math.max(this.folderDepth, pattern.split("\\[/").length - 1); this.enforcer = ProductContentEnforcer.create(patternList, getExclusionPatternList()); registerRGBProfile();
/** * Factory method that creates an instance of this class from a set of minimal patterns to be respected. * * @param minimalPatterns The set of patterns to be checked. * @return A new <code>ProductContentEnforcer</code> instance. */ public static ProductContentEnforcer create(String[] minimalPatterns) { return new ProductContentEnforcer(minimalPatterns, null); }