Interface ResourceProvider
-
- All Known Implementing Classes:
DefaultResourceProvider
public interface ResourceProvider
Provide system resource access toModelMapperSerializer
.- Author:
- Jeff Fischer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Delete all files in the filesystem at the location described intargetOut(String)
boolean
contains(String fileName)
Whether or not the filesystem contains the file at the destination described intargetOut(String)
String[]
contents()
All cache related artifact paths in the containing pathString
getResourcePrefix()
The classloader prefix under which all cache resources are locatedboolean
resourceAvailable(String fileName)
Whether or not the classpath contains the resource at the destination described intargetIn(String)
URL
resourcePath(String fileName)
InputStream
targetIn(String fileName)
For the filename, provide an InputStream from which to read the file.OutputStream
targetOut(String fileName)
For the filename, provide a OutputStream to write the file to.
-
-
-
Method Detail
-
targetOut
OutputStream targetOut(String fileName)
For the filename, provide a OutputStream to write the file to. Generally, this is a File in the mavenresources/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 inresources/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 intargetOut(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 intargetIn(String)
- Parameters:
fileName
- The name of the resource to check- Returns:
- Whether or not the classpath contains the resource
-
clear
void clear()
Delete all files in the filesystem at the location described intargetOut(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
-
-