Interface StaticAssetService

All Known Implementing Classes:
StaticAssetServiceImpl

public interface StaticAssetService
Created by bpolster.
  • Method Details

    • findStaticAssetById

      StaticAsset findStaticAssetById(Long id)
    • readAllStaticAssets

      List<StaticAsset> readAllStaticAssets()
    • findStaticAssetByFullUrl

      StaticAsset findStaticAssetByFullUrl(String fullUrl)
    • 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 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)

      Parameters:
      file - - the file being uploaded
      properties - - 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 controller

      To 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 from
      fileName - the name of the file
      fileSize - the size of the file, in bytes
      properties - additional metadata properties
      Returns:
    • getStaticAssetUrlPrefix

      @Deprecated String getStaticAssetUrlPrefix()
      Deprecated.
      since 3.1.0.
      See Also:
      • StaticAssetPathService.getStaticAssetUrlPrefix()
    • getPrefixedStaticAssetUrl

      String getPrefixedStaticAssetUrl(String assetUrl)
      Return a prefixed version of the given asset url, assuming a static asset url prefix is set
      Parameters:
      assetUrl -
      Returns:
    • getStaticAssetEnvironmentUrlPrefix

      @Deprecated String getStaticAssetEnvironmentUrlPrefix()
      Deprecated.
      since 3.1.0.
      See Also:
      • StaticAssetPathService.getStaticAssetEnvironmentUrlPrefix()
    • getStaticAssetEnvironmentSecureUrlPrefix

      @Deprecated String getStaticAssetEnvironmentSecureUrlPrefix()
      Deprecated.
      since 3.1.0.
      See Also:
      • StaticAssetPathService.getStaticAssetEnvironmentSecureUrlPrefix()
    • convertAssetPath

      @Deprecated String convertAssetPath(String assetPath, String contextPath, boolean secureRequest)
      Deprecated.
      since 3.1.0.
      See Also:
      • StaticAssetPathService.convertAssetPath(String, String, boolean)
    • addStaticAsset

      StaticAsset addStaticAsset(StaticAsset staticAsset)
      Add an asset outside of Broadleaf Admin.
      Parameters:
      staticAsset -
      Returns:
    • updateStaticAsset

      StaticAsset updateStaticAsset(StaticAsset staticAsset)
      Update an asset outside of Broadleaf Admin.
      Parameters:
      staticAsset -
      Returns:
    • deleteStaticAsset

      void deleteStaticAsset(StaticAsset staticAsset)
      Delete an asset outside of Broadleaf Admin.
      Parameters:
      staticAsset -