Interface ResourceProvider

All Known Implementing Classes:
DefaultResourceProvider

public interface ResourceProvider
Provide system resource access to ModelMapperSerializer.
Author:
Jeff Fischer
  • Method Details

    • targetOut

      OutputStream targetOut(String fileName)
      For the filename, provide a OutputStream to write the file to. Generally, this is a File in the maven resources/cache directory of the current application.
      Parameters:
      fileName - The name of the file to write
      Returns:
      the OutputStream to write the file to
    • targetIn

      InputStream targetIn(String fileName)
      For the filename, provide an InputStream from which to read the file. Generally, this is a resource on the classpath of the application in resources/cache.
      Parameters:
      fileName - The name of the resource to fetch
      Returns:
      The InputStream from which to read the resource
    • contains

      boolean contains(String fileName)
      Whether or not the filesystem contains the file at the destination described in targetOut(String)
      Parameters:
      fileName - The name of the file to check
      Returns:
      Whether or not the filesystem contains the file
    • contents

      String[] contents()
      All cache related artifact paths in the containing path
      Returns:
      All cache related artifact paths in the containing path
    • resourceAvailable

      boolean resourceAvailable(String fileName)
      Whether or not the classpath contains the resource at the destination described in targetIn(String)
      Parameters:
      fileName - The name of the resource to check
      Returns:
      Whether or not the classpath contains the resource
    • resourcePath

      URL resourcePath(String fileName)
    • clear

      void clear()
      Delete all files in the filesystem at the location described in targetOut(String)
    • getResourcePrefix

      String getResourcePrefix()
      The classloader prefix under which all cache resources are located
      Returns:
      The classloader prefix under which all cache resources are located