Interface StaticAssetService
- All Known Implementing Classes:
StaticAssetServiceImpl
-
Method Summary
Modifier and TypeMethodDescriptionaddStaticAsset
(StaticAsset staticAsset) Add an asset outside of Broadleaf Admin.convertAssetPath
(String assetPath, String contextPath, boolean secureRequest) Deprecated.since 3.1.0.createStaticAsset
(InputStream inputStream, String fileName, long fileSize, Map<String, String> properties) Similar tocreateStaticAssetFromFile(MultipartFile, Map)
except not dependent upon an uploaded file from a controllercreateStaticAssetFromFile
(org.springframework.web.multipart.MultipartFile file, Map<String, String> properties) Used when uploading a file to Broadleaf.void
deleteStaticAsset
(StaticAsset staticAsset) Delete an asset outside of Broadleaf Admin.findStaticAssetByFullUrl
(String fullUrl) getPrefixedStaticAssetUrl
(String assetUrl) Return a prefixed version of the given asset url, assuming a static asset url prefix is setDeprecated.since 3.1.0.Deprecated.since 3.1.0.Deprecated.since 3.1.0.updateStaticAsset
(StaticAsset staticAsset) Update an asset outside of Broadleaf Admin.
-
Method Details
-
findStaticAssetById
-
readAllStaticAssets
List<StaticAsset> readAllStaticAssets() -
findStaticAssetByFullUrl
-
findTotalStaticAssetCount
Long findTotalStaticAssetCount() -
createStaticAssetFromFile
StaticAsset createStaticAssetFromFile(org.springframework.web.multipart.MultipartFile file, Map<String, String> properties) Used when uploading a file to Broadleaf. This method will create the corresponding asset.
Depending on the the implementation, the actual asset may be saved to the DB or to the file system. The default implementation
StaticAssetServiceImpl
has a environment properties that determine this behaviorasset.use.filesystem.storage
The properties Map allows for implementors to update other Asset properties at the same time they are uploading a file. The default implementation uses this for an optional URL to be specified.
To actually create the physical file that this asset represents see
StaticAssetStorageService.createStaticAssetStorageFromFile(MultipartFile, StaticAsset)
- Parameters:
file
- - the file being uploadedproperties
- - additional meta-data properties- Returns:
- Throws:
IOException
- See Also:
-
createStaticAsset
StaticAsset createStaticAsset(InputStream inputStream, String fileName, long fileSize, Map<String, String> properties) Similar to
createStaticAssetFromFile(MultipartFile, Map)
except not dependent upon an uploaded file from a controllerTo actually create the physical file that this asset represents see
StaticAssetStorageService.createStaticAssetStorage(InputStream, StaticAsset)
- Parameters:
inputStream
- the input stream of a file to create the asset fromfileName
- the name of the filefileSize
- the size of the file, in bytesproperties
- additional metadata properties- Returns:
-
getStaticAssetUrlPrefix
Deprecated.since 3.1.0. -
getPrefixedStaticAssetUrl
Return a prefixed version of the given asset url, assuming a static asset url prefix is set- Parameters:
assetUrl
-- Returns:
-
getStaticAssetEnvironmentUrlPrefix
Deprecated.since 3.1.0. -
getStaticAssetEnvironmentSecureUrlPrefix
Deprecated.since 3.1.0. -
convertAssetPath
Deprecated.since 3.1.0. -
addStaticAsset
Add an asset outside of Broadleaf Admin.- Parameters:
staticAsset
-- Returns:
-
updateStaticAsset
Update an asset outside of Broadleaf Admin.- Parameters:
staticAsset
-- Returns:
-
deleteStaticAsset
Delete an asset outside of Broadleaf Admin.- Parameters:
staticAsset
-
-