Interface FileServiceProvider

All Known Implementing Classes:
FileSystemFileServiceProvider

public interface FileServiceProvider
Interface to be implemented by a FileProvider. This could be a local FileProvider or a remote service like Amazon S3.
Author:
bpolster
  • Method Details

    • getResource

      File getResource(String url)
      Returns a File representing the passed in url. All separators in the given url should be in URL-separator form meaning '/' rather than '\' (like on Windows).
      Parameters:
      url - - fully qualified path to the resource
      Returns:
    • getResource

      File getResource(String url, FileApplicationType fileApplicationType)
      Returns a File representing the passed in name and application type. Providers may choose to cache certain FileApplicationType(s) locally rather than retrieve them from a remote source.
      Parameters:
      url - - the URL-representation of the resource. This means that paths should always have / separators rather than system-specific values
      fileApplicationType - applicationType
      Returns:
      a File to the
    • addOrUpdateResources

      @Deprecated void addOrUpdateResources(FileWorkArea workArea, List<File> files, boolean removeFilesFromWorkArea)
      Takes in a work area and application type and moves all of the files to the configured FileProvider.
      Parameters:
      workArea -
      files - the files that should be copied
    • addOrUpdateResourcesForPaths

      List<String> addOrUpdateResourcesForPaths(FileWorkArea workArea, List<File> files, boolean removeFilesFromWorkArea)
      Adds all of the given files and returns the resource names of all of them suitable for invoking getResource(String) and/or removeResource(String)
      Parameters:
      workArea -
      files -
      removeFilesFromWorkArea -
      Returns:
      the resource names for each file that was uploaded. The resource names that are returned should be for each file in file
    • removeResource

      boolean removeResource(String name)
      Removes the resource from the file service.
      Parameters:
      name - - fully qualified path to the resource
      Returns:
      true if the resource was removed