code: public static List<CmsResource> calculateModuleResources(final CmsObject cms, final CmsModule module)
      throws CmsException {
  
          CmsObject cmsClone = adjustSiteRootIfNecessary(cms, module);
          List<CmsResource> result = null;
          List<String> excluded = CmsFileUtil.removeRedundancies(module.getExcludeResources());
          excluded = removeNonAccessible(cmsClone, excluded);
          List<String> resourceSitePaths = CmsFileUtil.removeRedundancies(module.getResources());
          resourceSitePaths = removeNonAccessible(cmsClone, resourceSitePaths);
  
          List<CmsResource> moduleResources = new ArrayList<CmsResource>(resourceSitePaths.size());
          for (String resourceSitePath : resourceSitePaths) {
              // assumes resources are accessible - already checked aboveremoveNonAccessible
              CmsResource resource = cmsClone.readResource(resourceSitePath);
              moduleResources.add(resource);
          }
  
          if (excluded.isEmpty()) {
              result = moduleResources;
          } else {
              result = new ArrayList<CmsResource>();
  
              addCalculatedModuleResources(result, cmsClone, moduleResources, excluded);
  
          }
          return result;
  
      }
docs: Calculates and returns the resources belonging to the module, taking excluded resources and readability of resources into account.
  The list of returned resources contains:
  <ul>
  <li>Only resources that are readable (present at the system and accessible with the provided {@link CmsObject}</li>
  <li>Only the resource for a folder, if <em>all</em> resources in the folder belong to the module.</li>
  <li>Only resources that are specified as module resources and <em>not</em> excluded by the module's exclude resources.</li>
  </ul>
  
  @param cms the {@link CmsObject} used to read the resources.
  @param module the module, for which the resources should be calculated
  @return the calculated module resources
  @throws CmsException thrown if reading resources fails.