Package com.gengoai.io.resource.spi
Interface ResourceProvider
-
- All Known Implementing Classes:
ByteArrayResourceProvider
,ClasspathResourceProvider
,FileResourceProvider
,StdinResourceProvider
,StdoutResourceProvider
,StringResourceProvider
,URLResourceProvider
,ZipResourceProvider
public interface ResourceProvider
Creates resources for a given SCHEME. This is used in the
Resources
class to determine which type of resource to create when callingResources.from(String)
.- Author:
- David B. Bracewell
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Resource
createResource(String specification, Map<String,String> properties)
Creates a resource with the given specification and properties using aBeanMap
.String[]
getProtocols()
boolean
requiresProtocol()
-
-
-
Method Detail
-
getProtocols
String[] getProtocols()
- Returns:
- The protocols that this provider supports (e.g. http, file, string, etc.)
-
createResource
Resource createResource(String specification, Map<String,String> properties)
Creates a resource with the given specification and properties using aBeanMap
.- Parameters:
specification
- The specificationproperties
- The properties- Returns:
- A resource
-
requiresProtocol
boolean requiresProtocol()
- Returns:
- True if the SCHEME is required as part of the specification
-
-