private Map<String, Resource> getClassPathResources(Map<String, String> resourceTypes) {

        // If no paths are provided, just return an empty map 
        if (resourceTypes == null)
            return Collections.<String, Resource>emptyMap();

        // Add classpath resource for each path/mimetype pair provided
        Map<String, Resource> resources = new HashMap<String, Resource>(resourceTypes.size());
        for (Map.Entry<String, String> resource : resourceTypes.entrySet()) {

            // Get path and mimetype from entry
            String path = resource.getKey();
            String mimetype = resource.getValue();

            // Store as path/resource pair
            resources.put(path, new ClassPathResource(classLoader, mimetype, path));

        }

        // Callers should not rely on modifying the result
        return Collections.unmodifiableMap(resources);

    }
private Map < String , Resource > getClassPathResources ( Map < String , String > resourceTypes ) { if ( resourceTypes == null ) return Collections . < String , Resource > emptyMap ( ) ; Map < String , Resource > resources = new HashMap < String , Resource > ( resourceTypes . size ( ) ) ; for ( Map . Entry < String , String > resource : resourceTypes . entrySet ( ) ) { String path = resource . getKey ( ) ; String mimetype = resource . getValue ( ) ; resources . put ( path , new ClassPathResource ( classLoader , mimetype , path ) ) ; } return Collections . unmodifiableMap ( resources ) ; }
Returns a new map of all resources corresponding to the map of resource
paths provided. Each resource will be associated with the mimetype
stored in the given map using its path as the key.

@param resourceTypes
A map of all paths to their corresponding mimetypes.

@return
A new, unmodifiable map of resources corresponding to the
collection of paths provided, where the key of each entry in the
map is the path for the resource stored in that entry.