class ClouderaManagerPackageLocationFilter implements PackageLocationFilter {

    @Override
    public boolean filterImage(Image image, Image currentImage) {
        if (image == null || image.getRepo() == null || currentImage == null || StringUtils.isBlank(currentImage.getOsType())) {
            LOGGER.debug("Image or repo is null: {}", image);
            return false;
        } else {
            String repoUrl = image.getRepo().getOrDefault(currentImage.getOsType(), "");
            LOGGER.debug("Matching URL: [{}]", repoUrl);
            return URL_PATTERN.matcher(repoUrl).find();
        }
    }

}