Class FileSchemaResolver
java.lang.Object
com.predic8.membrane.core.resolver.FileSchemaResolver
- All Implemented Interfaces:
Resolver,SchemaResolver
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetChildren(String url) Returns the list of child resources of the resource identified by the URL.longgetTimestamp(String url) Returns the modification date of the resource.voidobserveChange(String url, ExceptionThrowingConsumer<InputStream> consumer) Calls the consumer when the InputStream for the requested URL changes.Returns the InputStream for the requested URL.
-
Constructor Details
-
FileSchemaResolver
public FileSchemaResolver()
-
-
Method Details
-
getSchemas
- Specified by:
getSchemasin interfaceSchemaResolver- 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
Description copied from interface:ResolverReturns the InputStream for the requested URL.- Specified by:
resolvein interfaceResolver- 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:ResolverCalls the consumer when the InputStream for the requested URL changes.- Specified by:
observeChangein interfaceResolver- Throws:
ResourceRetrievalException- if the resource identified by the URL does not exist.
-
getChildren
Description copied from interface:ResolverReturns 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:
getChildrenin interfaceResolver- Returns:
- null if the resolver does not support this functionality.
-
getTimestamp
Description copied from interface:ResolverReturns the modification date of the resource.- Specified by:
getTimestampin interfaceResolver- Returns:
- 0 if the resolver does not support this functionality.
-