Class DefaultContentLoader

java.lang.Object
se.idsec.signservice.integration.core.DefaultContentLoader
All Implemented Interfaces:
ContentLoader

public class DefaultContentLoader extends Object implements ContentLoader
A ContentLoader that is used to load file resource contents. If Spring is in the classpath the org.springframework.core.io.DefaultResourceLoader class is used. Otherwise, we use our own (limited) implementation.
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Constructor Details

    • DefaultContentLoader

      public DefaultContentLoader()
      Constructor.
  • Method Details

    • loadContent

      public byte[] loadContent(String resource) throws IOException
      Loads the contents of the given resource.

      Note: The Spring Framework style of representing a resource must be supported by implementations. For example: classpath:xyz.svg and file:/path/xyz.svg.

      Specified by:
      loadContent in interface ContentLoader
      Parameters:
      resource - the resource to load
      Returns:
      the contents as a byte array
      Throws:
      IOException - if the contents can not be loaded