code: private Resource getMediaInlineResource(MediaRequest mediaRequest) {
      Resource resource = mediaRequest.getResource();
      if (resource == null) {
        return null;
      }
  
      // check if resource itself is a nt:file node
      if (JcrBinary.isNtFileOrResource(resource)) {
        return resource;
      }
  
      // check if child node exists which is a nt:file node
      String refProperty = StringUtils.defaultString(mediaRequest.getRefProperty(), mediaHandlerConfig.getMediaInlineNodeName());
      Resource mediaInlineResource = resource.getChild(refProperty);
      if (JcrBinary.isNtFileOrResource(mediaInlineResource)) {
        return mediaInlineResource;
      }
  
      // not found
      return null;
    }
docs: Get resource with media inline data (nt:file node).
  @param mediaRequest Media reference
  @return Resource or null if not present