Interface ResourceBundlingService
- All Known Implementing Classes:
ResourceBundlingServiceImpl
public interface ResourceBundlingService
This service is responsible for interaction with
ResourceBundleProcessor
and
ResourcePreloadProcessor
to generate bundles for static resources.- Author:
- Andre Azzolini (apazzolini), Brian Polster (bpolster)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkForRegisteredBundleFile
(String versionedBundleName) Tells if the given versioned bundle existsfindBundlesNameByResourceFileName
(String fileName) Returns names of bundles which contain the given filegetAdditionalBundleFiles
(String bundleName) Through configuration, you can provide additional files that will be automatically included for any bundle.org.springframework.core.io.Resource
rebuildBundledResource
(String requestedBundleName) Returns a newly rebuilt bundled resource given that the passed requestedBundleName had previously been built and cached/persisted via theresolveBundleResourceName(String, String, List)
method.boolean
removeBundle
(String bundleName) org.springframework.core.io.Resource
resolveBundleResource
(String versionedBundleResourceName) Returns a Resource for passed in versionedBundleResourceName.resolveBundleResourceName
(String requestedBundleName, String mappingPrefix, List<String> files) Returns a file name representing a versioned copy of the bundle.resolveBundleResourceName
(String requestedBundleName, String mappingPrefix, List<String> files, String bundleAppend) Returns a file name representing a versioned copy of the bundle with thebundleAppend
text appended to the end of the bundle.
-
Method Details
-
rebuildBundledResource
Returns a newly rebuilt bundled resource given that the passed requestedBundleName had previously been built and cached/persisted via theresolveBundleResourceName(String, String, List)
method.- Parameters:
requestedBundleName
- the requested bundle name- Returns:
- the rebuilt bundled resource
-
resolveBundleResourceName
String resolveBundleResourceName(String requestedBundleName, String mappingPrefix, List<String> files) Returns a file name representing a versioned copy of the bundle.First computes the bundle version by examining the files in the bundle. If the bundle does not exist, this method will create it.
- Parameters:
requestedBundleName
- the requested bundle namemappingPrefix
- the path prefix for the bundlefiles
- the files the bundle should contain- Returns:
- the bundle's resource name
-
resolveBundleResourceName
String resolveBundleResourceName(String requestedBundleName, String mappingPrefix, List<String> files, String bundleAppend) Returns a file name representing a versioned copy of the bundle with thebundleAppend
text appended to the end of the bundle.First computes the bundle version by examining the files in the bundle. If the bundle does not exist, this method will create it.
- Parameters:
requestedBundleName
- the requested bundle namemappingPrefix
- the path prefix for the bundlefiles
- the files the bundle should containbundleAppend
- the text to append at the end of the bundle- Returns:
- the bundle's resource name
-
resolveBundleResource
Returns a Resource for passed in versionedBundleResourceName.If the bundle does not exist, this method will attempt to create it by using the list of files that were registered with the initial call to
resolveBundleResourceName(String, String, List)
- Parameters:
versionedBundleResourceName
- the versioned bundle resource name- Returns:
- the bundle resource
-
getAdditionalBundleFiles
Through configuration, you can provide additional files that will be automatically included for any bundle. This method gets the list of configured additional files.- Parameters:
bundleName
- the name of the bundle to get additional files for- Returns:
- list of additional files
-
checkForRegisteredBundleFile
Tells if the given versioned bundle exists- Parameters:
versionedBundleName
- the versioned bundle name- Returns:
- true if the bundle exists, false otherwise
-
findBundlesNameByResourceFileName
Returns names of bundles which contain the given file- Parameters:
fileName
- file to find in the bungle- Returns:
- first bundle name that has file, null otherwise
-
removeBundle
-