Class FileSchemaResolver

java.lang.Object
com.predic8.membrane.core.resolver.FileSchemaResolver
All Implemented Interfaces:
Resolver, SchemaResolver

public class FileSchemaResolver extends Object implements SchemaResolver
  • Constructor Details

    • FileSchemaResolver

      public FileSchemaResolver()
  • Method Details

    • getSchemas

      public List<String> getSchemas()
      Specified by:
      getSchemas in interface SchemaResolver
      Returns:
      The list of schemas this resolver can handle ('http', 'https'). If the list contains null, this resolver will be used as the default resolver by its ResolverMap.
    • resolve

      public InputStream resolve(String fileUrl) throws ResourceRetrievalException
      Description copied from interface: Resolver
      Returns the InputStream for the requested URL.
      Specified by:
      resolve in interface Resolver
      Parameters:
      fileUrl - URL pointing to a file e.g. file:///users/viktor/foo
      Returns:
      InputStream for file
      Throws:
      ResourceRetrievalException - if the resource identified by the URL does not exist.
    • observeChange

      public void observeChange(String url, ExceptionThrowingConsumer<InputStream> consumer) throws ResourceRetrievalException
      Description copied from interface: Resolver
      Calls the consumer when the InputStream for the requested URL changes.
      Specified by:
      observeChange in interface Resolver
      Throws:
      ResourceRetrievalException - if the resource identified by the URL does not exist.
    • getChildren

      public List<String> getChildren(String url)
      Description copied from interface: Resolver
      Returns the list of child resources of the resource identified by the URL.

      For example, a list of filenames in the directory identified by the URL.

      Specified by:
      getChildren in interface Resolver
      Returns:
      null if the resolver does not support this functionality.
    • getTimestamp

      public long getTimestamp(String url)
      Description copied from interface: Resolver
      Returns the modification date of the resource.
      Specified by:
      getTimestamp in interface Resolver
      Returns:
      0 if the resolver does not support this functionality.