Class ResourceWithMetadata

java.lang.Object
com.broadleafcommerce.asset.storage.provider.service.ResourceWithMetadata
All Implemented Interfaces:
Serializable

public class ResourceWithMetadata extends Object implements Serializable
The Resource wrapper that contains the additional resource metadata.
Author:
Dima Myroniuk (dmyroniuk)
See Also:
  • Constructor Details

    • ResourceWithMetadata

      public ResourceWithMetadata()
    • ResourceWithMetadata

      public ResourceWithMetadata(org.springframework.core.io.Resource resource, @Nullable String filename, @Nullable String contentType, @Nullable String contentDisposition, long contentLength, Map<String,Object> additionalMetadata)
  • Method Details

    • getFilename

      @Nullable public String getFilename()
      Returns filename if it is not blank or the Resource filename.
      Returns:
      the file name of this resource or null if this type of resource does not have a filename
    • getResource

      public org.springframework.core.io.Resource getResource()
      The resource descriptor.
    • getContentType

      @Nullable public String getContentType()
      The content type of the resource if known when reading it.
    • getContentDisposition

      @Nullable public String getContentDisposition()
      The Content-Disposition HTTP header value of the resource if known when reading it.
    • getContentLength

      public long getContentLength()
      The Content-Length HTTP header value indicating the size of the associated object in bytes.
    • getAdditionalMetadata

      public Map<String,Object> getAdditionalMetadata()
      Any additional metadata for this resource.
    • setResource

      public void setResource(org.springframework.core.io.Resource resource)
      The resource descriptor.
    • setFilename

      public void setFilename(@Nullable String filename)
      The file name. Typically, the last part of the path — for example, "myfile.txt".
    • setContentType

      public void setContentType(@Nullable String contentType)
      The content type of the resource if known when reading it.
    • setContentDisposition

      public void setContentDisposition(@Nullable String contentDisposition)
      The Content-Disposition HTTP header value of the resource if known when reading it.
    • setContentLength

      public void setContentLength(long contentLength)
      The Content-Length HTTP header value indicating the size of the associated object in bytes.
    • setAdditionalMetadata

      public void setAdditionalMetadata(Map<String,Object> additionalMetadata)
      Any additional metadata for this resource.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object