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 Details

    • rebuildBundledResource

      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 the resolveBundleResourceName(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 name
      mappingPrefix - the path prefix for the bundle
      files - 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 the bundleAppend 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 name
      mappingPrefix - the path prefix for the bundle
      files - the files the bundle should contain
      bundleAppend - the text to append at the end of the bundle
      Returns:
      the bundle's resource name
    • resolveBundleResource

      org.springframework.core.io.Resource resolveBundleResource(String versionedBundleResourceName)
      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

      List<String> getAdditionalBundleFiles(String bundleName)
      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

      boolean checkForRegisteredBundleFile(String versionedBundleName)
      Tells if the given versioned bundle exists
      Parameters:
      versionedBundleName - the versioned bundle name
      Returns:
      true if the bundle exists, false otherwise
    • findBundlesNameByResourceFileName

      List<String> findBundlesNameByResourceFileName(String fileName)
      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

      boolean removeBundle(String bundleName)