code: private static String getMimeType(Iterable<Resource> resources) {
  
          // If no resources, just assume application/octet-stream
          Iterator<Resource> resourceIterator = resources.iterator();
          if (!resourceIterator.hasNext())
              return "application/octet-stream";
  
          // Return mimetype of first resource
          return resourceIterator.next().getMimeType();
  
      }
docs: Returns the mimetype of the first resource in the given Iterable, or
  "application/octet-stream" if no resources are provided.
  
  @param resources
  The resources from which the mimetype should be retrieved.
  
  @return
  The mimetype of the first resource, or "application/octet-stream"
  if no resources were provided.