@Service(value="blResourceBundlingService") public class ResourceBundlingServiceImpl extends java.lang.Object implements ResourceBundlingService
ResourceBundlingService| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
additionalBundleFiles |
protected java.lang.String |
assetFileSystemPath |
protected java.util.Map<java.lang.String,java.util.Collection<org.springframework.core.io.Resource>> |
bundles |
protected net.sf.ehcache.Cache |
bundleVersionsCache |
protected static java.lang.String |
DEFAULT_STORAGE_DIRECTORY |
protected static org.apache.commons.logging.Log |
LOG |
protected ResourceMinificationService |
minifyService |
| Constructor and Description |
|---|
ResourceBundlingServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.core.io.Resource |
createBundle(java.lang.String versionedBundleName) |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getAdditionalBundleFiles() |
java.util.List<java.lang.String> |
getAdditionalBundleFiles(java.lang.String bundleName) |
org.springframework.core.io.Resource |
getBundle(java.lang.String versionedBundleName)
For the given versioned bundle name, returns a Resource that holds the contents of the combined, and
possibly minified (if enabled) bundle.
|
protected java.lang.String |
getBundleName(java.lang.String bundleName,
java.lang.String version) |
protected java.lang.String |
getBundleVersion(java.util.LinkedHashMap<java.lang.String,org.springframework.core.io.Resource> foundResources) |
protected net.sf.ehcache.Cache |
getBundleVersionsCache() |
protected java.lang.String |
getFilePath(java.lang.String name) |
java.lang.String |
getVersionedBundleName(java.lang.String unversionedBundleName)
For a given unversioned bundle name, such as "global.js", returns the currently known versioned bundle
name, such as "global12345.js".
|
boolean |
hasBundle(java.lang.String versionedBundle) |
protected org.springframework.core.io.Resource |
readBundle(java.lang.String versionedBundleName) |
java.lang.String |
registerBundle(java.lang.String bundleName,
java.util.List<java.lang.String> files,
BroadleafResourceHttpRequestHandler handler)
Registers a new bundle with the given name to its files.
|
protected void |
saveBundle(org.springframework.core.io.Resource resource) |
void |
setAdditionalBundleFiles(java.util.Map<java.lang.String,java.util.List<java.lang.String>> additionalBundleFiles) |
protected static final org.apache.commons.logging.Log LOG
protected static final java.lang.String DEFAULT_STORAGE_DIRECTORY
protected java.util.Map<java.lang.String,java.util.Collection<org.springframework.core.io.Resource>> bundles
protected net.sf.ehcache.Cache bundleVersionsCache
protected java.util.Map<java.lang.String,java.util.List<java.lang.String>> additionalBundleFiles
@Value(value="${asset.server.file.system.path}")
protected java.lang.String assetFileSystemPath
protected ResourceMinificationService minifyService
public org.springframework.core.io.Resource getBundle(java.lang.String versionedBundleName)
ResourceBundlingServicegetBundle in interface ResourceBundlingServiceprotected org.springframework.core.io.Resource readBundle(java.lang.String versionedBundleName)
protected java.lang.String getFilePath(java.lang.String name)
protected org.springframework.core.io.Resource createBundle(java.lang.String versionedBundleName)
protected void saveBundle(org.springframework.core.io.Resource resource)
public java.lang.String getVersionedBundleName(java.lang.String unversionedBundleName)
ResourceBundlingServicegetVersionedBundleName in interface ResourceBundlingServicepublic boolean hasBundle(java.lang.String versionedBundle)
hasBundle in interface ResourceBundlingServicepublic java.lang.String registerBundle(java.lang.String bundleName,
java.util.List<java.lang.String> files,
BroadleafResourceHttpRequestHandler handler)
throws java.io.IOException
ResourceBundlingServiceregisterBundle in interface ResourceBundlingServicejava.io.IOExceptionprotected java.lang.String getBundleName(java.lang.String bundleName,
java.lang.String version)
protected java.lang.String getBundleVersion(java.util.LinkedHashMap<java.lang.String,org.springframework.core.io.Resource> foundResources)
throws java.io.IOException
java.io.IOExceptionpublic java.util.List<java.lang.String> getAdditionalBundleFiles(java.lang.String bundleName)
getAdditionalBundleFiles in interface ResourceBundlingServicepublic java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAdditionalBundleFiles()
public void setAdditionalBundleFiles(java.util.Map<java.lang.String,java.util.List<java.lang.String>> additionalBundleFiles)
protected net.sf.ehcache.Cache getBundleVersionsCache()
Copyright © 2018. All Rights Reserved.