Class DefaultResourceProvider

java.lang.Object
ru.cg.webbpm.modules.resources.impl.DefaultResourceProvider
All Implemented Interfaces:
ResourceProvider

@Component public class DefaultResourceProvider extends Object implements ResourceProvider
Author:
Rinat Suleymanov
  • Constructor Details

    • DefaultResourceProvider

      @Autowired public DefaultResourceProvider(org.springframework.core.io.support.ResourcePatternResolver patternResolver)
  • Method Details

    • getResourceAsStreamByPath

      public InputStream getResourceAsStreamByPath(String path)
      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 interface ResourceProvider
      Parameters:
      path - full file path.
      Returns:
      input stream representation of resource.
      See Also:
    • getResourceAsBytesByPath

      public byte[] getResourceAsBytesByPath(String path)
      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 interface ResourceProvider
      Parameters:
      path - full file path.
      Returns:
      byte array representation of resource.
      See Also:
    • getResourceAsUrlByPath

      public URL getResourceAsUrlByPath(String path)
      Description copied from interface: ResourceProvider
      Returns resource as URL by full file path.
      Specified by:
      getResourceAsUrlByPath in interface ResourceProvider
      Parameters:
      path - full file path.
      Returns:
      URL representation of resource.
    • getResourcesAsStreamsByExt

      public Collection<InputStream> getResourcesAsStreamsByExt(String extension)
      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 interface ResourceProvider
      Parameters:
      extension - file extension.
      Returns:
      collection of resources in input stream representation.
    • getResourcesAsBytesByExt

      public Collection<byte[]> getResourcesAsBytesByExt(String extension)
      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 interface ResourceProvider
      Parameters:
      extension - file extension.
      Returns:
      collection of resources in byte array representation.
    • getResourcesAsUrlByExt

      public Collection<URL> getResourcesAsUrlByExt(String extension)
      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 interface ResourceProvider
      Parameters:
      extension - file extension.
      Returns:
      collection of resources in URL representation.
    • getResourcesAsStreamsByPattern

      public Collection<InputStream> getResourcesAsStreamsByPattern(String pattern)
      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 interface ResourceProvider
      Parameters:
      pattern - file extension.
      Returns:
      collection of resources in input stream representation.
    • getResourcesAsBytesByPattern

      public Collection<byte[]> getResourcesAsBytesByPattern(String pattern)
      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 interface ResourceProvider
      Parameters:
      pattern - file extension.
      Returns:
      collection of resources in byte array representation.
    • getResourcesAsUrlByPattern

      public Collection<URL> getResourcesAsUrlByPattern(String pattern)
      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 interface ResourceProvider
      Parameters:
      pattern - file extension.
      Returns:
      collection of resources in URL representation.
    • getResourceFilesByPattern

      public Collection<ResourceFile> getResourceFilesByPattern(String pattern)
      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 interface ResourceProvider
      Parameters:
      pattern - file extension.
      Returns:
      collection of resources in ResourceFile representation.