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 ) ; }
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 .