Checks if the file extension of the current binary matches with the requested extensions from the media args.
@return true if file extension matches
17703
private boolean isMatchingFileExtension() {
    String[] fileExtensions = mediaArgs.getFileExtensions();
    if (fileExtensions == null || fileExtensions.length == 0) {
      return true;
    }
    for (String fileExtension : fileExtensions) {
      if (StringUtils.equalsIgnoreCase(fileExtension, getFileExtension())) {
        return true;
      }
    }
    return false;
  }
79659
@Override
    public boolean matches(String fileName) {
        // Special case: if no classes or packages have been defined,
        // then the screener matches all class files.
        if (patternList.isEmpty()) {
            return true;
        }

        LOG.debug("Matching: {}", fileName);

        // Scan through list of regexes
        for (Matcher matcher : patternList) {
            matcher.reset(fileName);
            if (matcher.find()) {
                LOG.debug("\\tTrying [{}]: yes!", matcher.pattern());
                return true;
            }
            LOG.debug("\\tTrying [{}]: no", matcher.pattern());
        }
        return false;
    }
152683
public function match(string $filename): bool
    {
        $extension = pathinfo($filename, PATHINFO_EXTENSION);
        return strtolower($extension) == $this->extension;
    }
602195
private boolean isIntExtension(int typeByte) {
        return typeByte == MsgPack.FIX_EXT_1 || typeByte == MsgPack.FIX_EXT_2 || typeByte == MsgPack.FIX_EXT_4;
    }
1146789
@Override
    public boolean matches(Source src) {
        String name = src.getOrigin().getName().toLowerCase();
        if (FilenameUtils.isExtension(name, new String[]{"markdown", "md"})) {
            return true;
        }
        if ("post".equals(src.getMeta().get("layout")) && FilenameUtils.isExtension(name, "txt")) {
            return true;
        }
        return false;
    }
1015672
public boolean matches(MediaQuery q)
    {
        //match the media type
        if (q.getType() != null)
        {
            if (q.getType().equals("all"))
            {
                if (q.isNegative())
                    return false; //"NOT all" doesn't match to anything
            }
            else if (q.getType().equals(this.getType()) == q.isNegative()) //other than all
                return false;
        }
        //match the eventual expressions
        for (MediaExpression e : q)
        {
            if (!this.matches(e))
                return false;
        }
        //everything matched
        return true;
    }
265725
@SuppressWarnings("rawtypes")
    public static boolean areFileExtensionsEnabled() {
        Config config = GrailsWebUtil.currentApplication().getConfig();
        return config.getProperty(ENABLE_FILE_EXTENSIONS, Boolean.class, true);
    }
195777
private boolean checkMatch() {
        if (matchList == null) {
            return true;
        }
        final int matchSize = matchList.size();
        final int ancestorSize = topicIdList.size();
        final List<String> tail = topicIdList.subList(ancestorSize - matchSize, ancestorSize);
        return matchList.equals(tail);
    }
991659
public static boolean isImage(String extension)
  {
    return extension != null ? IMAGE_FILE_EXTENSIONS.contains(extension.toLowerCase()) : false;
  }
676786
public static boolean isMarkdownFileExtension(String extension) {
		for (final String ext : MARKDOWN_FILE_EXTENSIONS) {
			if (Strings.equal(ext, extension)) {
				return true;
			}
		}
		return false;
	}
508612
public static function ValidExtension()
    {
        $dir = self::GetCwd();

        if(
            // Templates
            is_dir($dir . "/templates") &&
            
            // Peg configuration file
            (file_exists($dir . "/peg.conf") || file_exists($dir . "/peg.json"))
        )
        {
            return true;
        }

        return false;
    }
1112345
@Override
  public MediaFormat detectMediaFormat(@Nullable String extension, long fileSize, long width, long height) {
    SortedSet<MediaFormat> matchingFormats = detectMediaFormats(extension, fileSize, width, height);
    return !matchingFormats.isEmpty() ? matchingFormats.first() : null;
  }
1040521
public static boolean isZip(String fileName) {
		if (fileName == null) {
			return false;
		}

		String tl = fileName.toLowerCase();
		for (String element : ZIP_EXTENSIONS) {
			if (tl.endsWith(element)) {
				return true;
			}
		}
		return false;
	}
620297
@Override
	protected String getContentType(String filePath, HttpServletRequest request) {
		String requestUri = request.getRequestURI();

		// Retrieve the extension
		String extension = getExtension(filePath);
		if (extension == null) {

			LOGGER.info("No extension found for the request URI : " + requestUri);
			return null;
		}

		String binContentType = (String) binaryMimeTypeMap.get(extension);
		if (binContentType == null) {

			LOGGER.info(
					"No binary extension match the extension '" + extension + "' for the request URI : " + requestUri);
			return null;
		}
		return binContentType;
	}
317470
def file_matches_extensions(self, fname, extensions):
        
        if not isinstance(extensions, list):
            extensions = [extensions]
        for ext in extensions:
            if fname.endswith('.%s' % ext):
                return True
        return False
472243
protected function _matchType()
    {
        if (!$this->_types) {
            return true;
        }
        $file = $this->current();
        foreach ($this->_types as $type) {
            $method = 'is' . ucfirst($type);
            if ($file->$method()) {
                return true;
            }
        }
        return false;
    }
162661
public function checkForFFmpeg()
    {
        $binaries = [
            'ffmpeg',
        ];

        foreach ($binaries as $binary) {
            $output = shell_exec("which {$binary}");

            if (! empty($output)) {
                return true;
            }
        }

        $this->emit('error', [new FFmpegNotFoundException('No FFmpeg binary was found.')]);

        return false;
    }