public interface StaticAssetService
Modifier and Type | Method and Description |
---|---|
StaticAsset |
addStaticAsset(StaticAsset staticAsset)
Add an asset outside of Broadleaf Admin.
|
String |
convertAssetPath(String assetPath,
String contextPath,
boolean secureRequest)
Deprecated.
since 3.1.0.
|
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
controller |
StaticAsset |
createStaticAssetFromFile(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.
|
StaticAsset |
findStaticAssetByFullUrl(String fullUrl) |
StaticAsset |
findStaticAssetById(Long id) |
Long |
findTotalStaticAssetCount() |
String |
getPrefixedStaticAssetUrl(String assetUrl)
Return a prefixed version of the given asset url, assuming a static asset url prefix is set
|
String |
getStaticAssetEnvironmentSecureUrlPrefix()
Deprecated.
since 3.1.0.
|
String |
getStaticAssetEnvironmentUrlPrefix()
Deprecated.
since 3.1.0.
|
String |
getStaticAssetUrlPrefix()
Deprecated.
since 3.1.0.
|
List<StaticAsset> |
readAllStaticAssets() |
StaticAsset |
updateStaticAsset(StaticAsset staticAsset)
Update an asset outside of Broadleaf Admin.
|
StaticAsset findStaticAssetById(Long id)
List<StaticAsset> readAllStaticAssets()
StaticAsset findStaticAssetByFullUrl(String fullUrl)
Long findTotalStaticAssetCount()
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 behavior asset.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)
file
- - the file being uploadedproperties
- - additional meta-data propertiesIOException
StaticAssetServiceImpl
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
controller
To actually create the physical file that this asset represents see
StaticAssetStorageService.createStaticAssetStorage(InputStream, StaticAsset)
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@Deprecated String getStaticAssetUrlPrefix()
String getPrefixedStaticAssetUrl(String assetUrl)
assetUrl
- @Deprecated String getStaticAssetEnvironmentUrlPrefix()
@Deprecated String getStaticAssetEnvironmentSecureUrlPrefix()
@Deprecated String convertAssetPath(String assetPath, String contextPath, boolean secureRequest)
StaticAsset addStaticAsset(StaticAsset staticAsset)
staticAsset
- StaticAsset updateStaticAsset(StaticAsset staticAsset)
staticAsset
- void deleteStaticAsset(StaticAsset staticAsset)
staticAsset
- Copyright © 2022. All rights reserved.