code: public Map<Locale, CmsResource> getResourcesByLocale() {
  
          List<CmsResource> resources = Lists.newArrayList();
          resources.add(m_primaryResource);
          resources.addAll(m_secondaryResources);
          Collections.sort(resources, new Comparator<CmsResource>() {
  
              public int compare(CmsResource arg0, CmsResource arg1) {
  
                  String path1 = arg0.getRootPath();
                  String path2 = arg1.getRootPath();
                  return path2.compareTo(path1);
              }
  
          });
          Map<Locale, CmsResource> result = new LinkedHashMap<Locale, CmsResource>();
          for (CmsResource resource : resources) {
              result.put(m_localeCache.get(resource), resource);
          }
          return result;
  
      }
docs: Gets a map which contains the resources of the locale group as keys, indexed by their locale.<p>
  
  If the locale group contains more than one resource from the same locale,, which one is used a map value is undefined.
  
  @return the map of resources by locale