Class ReactiveResourceUtil

java.lang.Object
org.springframework.data.elasticsearch.core.ReactiveResourceUtil

public abstract class ReactiveResourceUtil extends Object
Utility to reactively read Resources.
Since:
4.1
Author:
Peter-Josef Meisch
  • Method Details

    • readFileFromClasspath

      public static reactor.core.publisher.Mono<String> readFileFromClasspath(String url)
      Read a ClassPathResource into a reactor.core.publisher.Mono<String>.
      Parameters:
      url - the resource to read
      Returns:
      a Mono emitting the resources content or an empty Mono on error
    • loadDocument

      public static reactor.core.publisher.Mono<Document> loadDocument(String path, String annotation)
      loads a Document initialized with data from a given resource path.
      Parameters:
      path - the path to load data from
      annotation - the annotation that had the resource path defined
      Returns:
      the parsed document
      Since:
      4.4