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 Summary
Modifier and TypeMethodDescriptionvoid
addOrUpdateResources
(FileWorkArea workArea, List<File> files, boolean removeFilesFromWorkArea) Deprecated.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 invokinggetResource(String)
and/orremoveResource(String)
getResource
(String url) Returns a File representing the passed in url.getResource
(String url, FileApplicationType fileApplicationType) Returns a File representing the passed in name and application type.boolean
removeResource
(String name) Removes the resource from the file service.
-
Method Details
-
getResource
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
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 valuesfileApplicationType
- applicationType- Returns:
- a File to the
-
addOrUpdateResources
@Deprecated void addOrUpdateResources(FileWorkArea workArea, List<File> files, boolean removeFilesFromWorkArea) Deprecated.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 invokinggetResource(String)
and/orremoveResource(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
Removes the resource from the file service.- Parameters:
name
- - fully qualified path to the resource- Returns:
- true if the resource was removed
-
addOrUpdateResourcesForPaths(FileWorkArea, List, boolean)