Class DefaultResourceProvider
java.lang.Object
com.broadleafcommerce.data.tracking.core.mapping.cache.DefaultResourceProvider
- All Implemented Interfaces:
ResourceProvider
Default implementation of
ResourceProvider.- Author:
- Jeff Fischer
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Delete all files in the filesystem at the location described inResourceProvider.targetOut(String)booleanWhether or not the filesystem contains the file at the destination described inResourceProvider.targetOut(String)String[]contents()All cache related artifact paths in the containing pathprotected FileRetrieve archive directory if still exists at the old build location (src/main/resources/cache).The classloader prefix under which all cache resources are locatedbooleanresourceAvailable(String fileName) Whether or not the classpath contains the resource at the destination described inResourceProvider.targetIn(String)resourcePath(String fileName) voidsetProperties(ModelMapperCacheProperties properties) For the filename, provide an InputStream from which to read the file.For the filename, provide a OutputStream to write the file to.
-
Field Details
-
CACHEINF_DIR
- See Also:
-
CACHE_DIR
- See Also:
-
-
Constructor Details
-
DefaultResourceProvider
public DefaultResourceProvider()
-
-
Method Details
-
targetOut
Description copied from interface:ResourceProviderFor the filename, provide a OutputStream to write the file to. Generally, this is a File in the mavenresources/cachedirectory of the current application.- Specified by:
targetOutin interfaceResourceProvider- Parameters:
fileName- The name of the file to write- Returns:
- the OutputStream to write the file to
-
targetIn
Description copied from interface:ResourceProviderFor the filename, provide an InputStream from which to read the file. Generally, this is a resource on the classpath of the application inresources/cache.- Specified by:
targetInin interfaceResourceProvider- Parameters:
fileName- The name of the resource to fetch- Returns:
- The InputStream from which to read the resource
-
contents
Description copied from interface:ResourceProviderAll cache related artifact paths in the containing path- Specified by:
contentsin interfaceResourceProvider- Returns:
- All cache related artifact paths in the containing path
-
resourceAvailable
Description copied from interface:ResourceProviderWhether or not the classpath contains the resource at the destination described inResourceProvider.targetIn(String)- Specified by:
resourceAvailablein interfaceResourceProvider- Parameters:
fileName- The name of the resource to check- Returns:
- Whether or not the classpath contains the resource
-
resourcePath
- Specified by:
resourcePathin interfaceResourceProvider
-
contains
Description copied from interface:ResourceProviderWhether or not the filesystem contains the file at the destination described inResourceProvider.targetOut(String)- Specified by:
containsin interfaceResourceProvider- Parameters:
fileName- The name of the file to check- Returns:
- Whether or not the filesystem contains the file
-
clear
public void clear()Description copied from interface:ResourceProviderDelete all files in the filesystem at the location described inResourceProvider.targetOut(String)- Specified by:
clearin interfaceResourceProvider
-
getResourcePrefix
Description copied from interface:ResourceProviderThe classloader prefix under which all cache resources are located- Specified by:
getResourcePrefixin interfaceResourceProvider- Returns:
- The classloader prefix under which all cache resources are located
-
determineOldResourceDir
Retrieve archive directory if still exists at the old build location (src/main/resources/cache). -
determineCacheResourceDir
-
setProperties
-