Check if the passed file is already compressed. The check is only done
using the file extension of the file name.

@param sFilename
The filename to be checked.
@return <code>true</code> if the file is already compressed.
505667
private static boolean _isAlreadyCompressed (final String sFilename)
  {
    for (final String sExt : EXTENSIONS_CSS_COMPRESSED)
      if (sFilename.endsWith (sExt))
        return true;
    return false;
  }
635202
@Nullable
    public static String getFileExtension(@NotNull String fileName) {
        @Nullable
        final String fileExt = FilenameUtils.getExtension(fileName);
        return StringUtils.isNoneEmpty(fileExt) ? StringUtils.lowerCase(fileExt) : null;
    }
560968
public static boolean containsInvalid(String fileName) {
		return StrUtil.isBlank(fileName) ? false : ReUtil.contains(FILE_NAME_INVALID_PATTERN_WIN, fileName);
	}
53958
public static boolean isCsvFile(String filename)
    {
        String lowerFilename = filename.toLowerCase();
        return lowerFilename.endsWith("."+CommonFiles.CSV_EXT);
    }
190731
public static boolean isFileUpdate(String oldName, String newName) {

        return isFileEqual(new File(oldName), new File(newName));
    }
282114
def check_if_committed(self, filename: str) -> bool:
        
        if os.path.isfile(filename + '.json.xz'):
            filename += '.json.xz'
        elif os.path.isfile(filename + '.json'):
            filename += '.json'
        else:
            return False
        try:
            load_structure_from_file(self.context, filename)
            return True
        except (FileNotFoundError, lzma.LZMAError, json.decoder.JSONDecodeError):
            return False
720691
public function isImageFileExtensionKosher($filename) {

        // must have acceptable file extension
        $imageFileExtension = $this->ImagesHelper->filenameWithExtensionOnly($filename);

        $haystack = Config::get('lasallecmsfrontend.acceptable_image_extensions_for_uploading');

        if (in_array(strtolower($imageFileExtension), $haystack)) {
            return true;
        }

        return false;
    }
234661
public boolean isSupported(String fileName) {
		String extension = getExtension(fileName);

		return isInternalSupported(extension) || isExternalSupported(extension);
	}
1320585
public static String getExtension(String fileName) {
		if (fileName==null){
			return null;
		} else {
			int number=fileName.lastIndexOf('.');
			
			if (number>=0){
				return fileName.substring(number+1, fileName.length());
			} else {
				return null;
			}
		}		
	}
757339
public static CompressionType getDumpFileCompressionType(String fileName) {
		if (fileName.endsWith(".gz")) {
			return CompressionType.GZIP;
		} else if (fileName.endsWith(".bz2")) {
			return CompressionType.BZ2;
		} else {
			return CompressionType.NONE;
		}
	}
852839
public static String getSafeExtension(final String filename) {
        // extension does not include period (.)
        final String extension = FilenameUtils.getExtension(filename);
        return isSafeExtension(extension) ? "." + extension : StringUtils.EMPTY;
    }
935924
public static boolean isValidFileName(@Nullable String name) {
        return !TextUtils.isEmpty(name)
                && !name.contains("/")
                && !name.equals(".")
                && !name.equals("..");
    }
922880
public static function fileExistsInPath(string $filename) {
		$paths = explode(';', str_replace(':', ';', get_include_path()));
		foreach($paths as $v) {
			if (file_exists($v . DIRECTORY_SEPARATOR . $filename)) {
				return $v . DIRECTORY_SEPARATOR . $filename;
			}
		}
		return false;
	}
1023428
private function validateFileExtension($filename)
    {
        // no UNIX-hidden files
        if ($filename[0] === '.') {
            return false;
        }
        // only whitelisted extensions
        $extension = pathinfo($filename, PATHINFO_EXTENSION);
        $allowedExtensions = $this->getAllowedUploadExtensions();

        return $extension === '' || in_array(mb_strtolower($extension), $allowedExtensions);
    }
450393
public boolean isFresh(final String filename) {
        final FileSystem fileSystem = vertx.fileSystem();

        try {
            FileProps fileProps = fileSystem.propsBlocking(filename);
            LRUCache.CacheEntry<String, T> cacheEntry = cache.get(filename);
            final long lastModified = fileProps.lastModifiedTime();

            if (cacheEntry == null) {
                return false;
            }
            if (cacheEntry.isFresh(lastModified)) {
                return true;
            }
            // not fresh anymore, purge it
            cache.remove(filename);
            return false;
        } catch (RuntimeException e) {
            return false;
        }
    }
71671
protected function checkFileName($fileName)
    {
        $extension = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));

        $allow = $this->getWhitelistedExtensions();
        $block = $this->getBlacklistedExtensions();

        return  (   (false === $allow || in_array($extension, $allow))
                &&  (false === $block || ! in_array($extension, $block))
                );
    }
650472
protected static boolean isValidFilename(String filename) {
		if (filename == null || filename.length() == 0) {
			throw new NullPointerException("文件名不能为空.");
		}
		if (filename.indexOf("..") != -1) {
			throw new IllegalArgumentException("文件名称不能包含'..'");
		}
		Matcher m = FILENAME_PATTERN.matcher(filename);
		return m.matches();
	}