code: private static List<String> getExcludedForResource(final String sitePath, final List<String> excluded) {
  
          List<String> result = new ArrayList<String>();
          for (String exclude : excluded) {
              if (CmsStringUtil.isPrefixPath(sitePath, exclude)) {
                  result.add(exclude);
              }
          }
          return result;
      }
docs: Returns only the resource names starting with the provided <code>sitePath</code>.
  
  @param sitePath the site relative path, all paths should start with.
  @param excluded the paths to filter.
  @return the paths from <code>excluded</code>, that start with <code>sitePath</code>.