code: private static MimeType getParentMimeType(Resource resource) {
          MimeType result = null;
          if (resource != null && (resource = resource.getParent()) != null) {
              ResourceHandle handle = ResourceHandle.use(resource);
              result = getMimeType(handle.getProperty(ResourceUtil.PROP_MIME_TYPE, ""));
              if (result == null) {
                  String filename = getResourceName(resource);
                  result = getMimeType(filename);
              }
          }
          return result;
      }
docs: a helper if the resource is a content node an should use its parent as a fallback