Class FilesystemResourceProviderImpl

java.lang.Object
com.peterphi.std.guice.common.resource.impl.FilesystemResourceProviderImpl
All Implemented Interfaces:
ResourceProvider

public class FilesystemResourceProviderImpl extends Object implements ResourceProvider
An implementation of ResourceProvider that loads resources from a folder on the local filesystem
  • Constructor Details

    • FilesystemResourceProviderImpl

      public FilesystemResourceProviderImpl(File root)
  • Method Details

    • getBinaryResource

      public InputStream getBinaryResource(String name)
      Description copied from interface: ResourceProvider
      Loads a binary resource
      Specified by:
      getBinaryResource in interface ResourceProvider
      Parameters:
      name - the resource name, expressed as a path (see the comments on ResourceProvider)
      Returns:
    • getTextResource

      public Reader getTextResource(String name)
      Description copied from interface: ResourceProvider
      Loads a text resource. If it is necessary to make assumptions about the underlying encoding of a resource (e.g. the remote resource provider does not support then UTF-8 will be used
      Specified by:
      getTextResource in interface ResourceProvider
      Parameters:
      name - the resource name, expressed as a path using / as a separator character
      Returns:
    • getPropertyResource

      public PropertyFile getPropertyResource(String name)
      Description copied from interface: ResourceProvider
      Loads a resource containing a property file
      Specified by:
      getPropertyResource in interface ResourceProvider
      Parameters:
      name - the resource name, expressed as a path with / characters to separate
      Returns: