Class DefaultResourceProvider
java.lang.Object
ru.cg.webbpm.modules.resources.impl.DefaultResourceProvider
- All Implemented Interfaces:
ResourceProvider
- Author:
- Rinat Suleymanov
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultResourceProvider
(org.springframework.core.io.support.ResourcePatternResolver patternResolver) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Returns resource as byte array by full file path.Returns resource as input stream by full file path.getResourceAsUrlByPath
(String path) Returns resource as URL by full file path.getResourceFilesByPattern
(String pattern) Returns collection of resources by regex pattern.Collection<byte[]>
getResourcesAsBytesByExt
(String extension) Returns collection of resources by file extension.Collection<byte[]>
getResourcesAsBytesByPattern
(String pattern) Returns collection of resources by regex pattern.getResourcesAsStreamsByExt
(String extension) Returns collection of resources by file extension.getResourcesAsStreamsByPattern
(String pattern) Returns collection of resources by regex pattern.getResourcesAsUrlByExt
(String extension) Returns collection of resources by file extension.getResourcesAsUrlByPattern
(String pattern) Returns collection of resources by regex pattern.
-
Constructor Details
-
DefaultResourceProvider
@Autowired public DefaultResourceProvider(org.springframework.core.io.support.ResourcePatternResolver patternResolver)
-
-
Method Details
-
getResourceAsStreamByPath
Description copied from interface:ResourceProvider
Returns resource as input stream by full file path. For example, file path: "process_definitions/process1.bpmn2".- Specified by:
getResourceAsStreamByPath
in interfaceResourceProvider
- Parameters:
path
- full file path.- Returns:
- input stream representation of resource.
- See Also:
-
getResourceAsBytesByPath
Description copied from interface:ResourceProvider
Returns resource as byte array by full file path. For example, file path: "process_definitions/process1.bpmn2".- Specified by:
getResourceAsBytesByPath
in interfaceResourceProvider
- Parameters:
path
- full file path.- Returns:
- byte array representation of resource.
- See Also:
-
getResourceAsUrlByPath
Description copied from interface:ResourceProvider
Returns resource as URL by full file path.- Specified by:
getResourceAsUrlByPath
in interfaceResourceProvider
- Parameters:
path
- full file path.- Returns:
- URL representation of resource.
-
getResourcesAsStreamsByExt
Description copied from interface:ResourceProvider
Returns collection of resources by file extension. Resources are in input stream representation. For example, file extension: "bpmn2".- Specified by:
getResourcesAsStreamsByExt
in interfaceResourceProvider
- Parameters:
extension
- file extension.- Returns:
- collection of resources in input stream representation.
-
getResourcesAsBytesByExt
Description copied from interface:ResourceProvider
Returns collection of resources by file extension. Resources are in byte array representation. For example, file extension: "bpmn2".- Specified by:
getResourcesAsBytesByExt
in interfaceResourceProvider
- Parameters:
extension
- file extension.- Returns:
- collection of resources in byte array representation.
-
getResourcesAsUrlByExt
Description copied from interface:ResourceProvider
Returns collection of resources by file extension. Resources are in URL representation. For example, file extension: "bpmn2".- Specified by:
getResourcesAsUrlByExt
in interfaceResourceProvider
- Parameters:
extension
- file extension.- Returns:
- collection of resources in URL representation.
-
getResourcesAsStreamsByPattern
Description copied from interface:ResourceProvider
Returns collection of resources by regex pattern. Resources are in input stream representation. For example, regex pattern: "bpmn2".- Specified by:
getResourcesAsStreamsByPattern
in interfaceResourceProvider
- Parameters:
pattern
- file extension.- Returns:
- collection of resources in input stream representation.
-
getResourcesAsBytesByPattern
Description copied from interface:ResourceProvider
Returns collection of resources by regex pattern. Resources are in byte array representation. For example, regex pattern: "bpmn2".- Specified by:
getResourcesAsBytesByPattern
in interfaceResourceProvider
- Parameters:
pattern
- file extension.- Returns:
- collection of resources in byte array representation.
-
getResourcesAsUrlByPattern
Description copied from interface:ResourceProvider
Returns collection of resources by regex pattern. Resources are in URL representation. For example, regex pattern: "bpmn2".- Specified by:
getResourcesAsUrlByPattern
in interfaceResourceProvider
- Parameters:
pattern
- file extension.- Returns:
- collection of resources in URL representation.
-
getResourceFilesByPattern
Description copied from interface:ResourceProvider
Returns collection of resources by regex pattern. Resources are in ResourceFile representation. For example, regex pattern: "bpmn2".- Specified by:
getResourceFilesByPattern
in interfaceResourceProvider
- Parameters:
pattern
- file extension.- Returns:
- collection of resources in ResourceFile representation.
-