public static URL validateURL(String fileName, BeanContainer beanContainer) {
        DozerClassLoader classLoader = beanContainer.getClassLoader();
        if (fileName == null) {
            MappingUtils.throwMappingException("File name is null");
        }

        URL url = classLoader.loadResource(fileName);
        if (url == null) {
            DozerClassLoader tccl = beanContainer.getTCCL();
            url = tccl.loadResource(fileName);
            if (url == null) {
                MappingUtils.throwMappingException("Unable to locate dozer mapping file [" + fileName + "] in the classpath!");
            }
        }

        InputStream stream = null;
        try {
            stream = url.openStream();
        } catch (IOException e) {
            MappingUtils.throwMappingException("Unable to open URL input stream for dozer mapping file [" + url + "]");
        } finally {
            if (stream != null) {
                try {
                    stream.close();
                } catch (IOException e) {
                    MappingUtils.throwMappingException("Unable to close input stream for dozer mapping file [" + url + "]");
                }
            }
        }

        return url;
    }
Internal class used to perform various validations. Validates mapping requests, field mappings, URL's, etc. Only
intended for internal use.
core/src/main/java/com/github/dozermapper/core/util/MappingValidator.java