Interface ResourceMetadata

All Known Implementing Classes:
SimpleResourceMetadata

public interface ResourceMetadata
Metadata about a resource.
Since:
1.54
Version:
1.0
Author:
matt
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The metadata map key for the getModified() value.
    static final org.springframework.util.MimeType
    The default content type value.
    static final String
    The metadata map key for the getModified() value.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Map<String,?>
    Get the metadata as a map of key-value pairs, excluding any standard metadata properties so that only custom metadata values are included.
    default Map<String,?>
    Get the metadata as a map of key-value pairs.
    default Map<String,?>
    Get the metadata as a map of key-value pairs, excluding any custom metadata properties so that only standard metadata values are included.
    default org.springframework.util.MimeType
    Get the resource content type.
    Get the modification date, if known.
    default boolean
    Test if a metadata map key is standard or custom.
    default void
    Populate a map with all available metadata key-value pairs.
  • Field Details

  • Method Details

    • getModified

      Date getModified()
      Get the modification date, if known.
      Returns:
      the modified date, or null if not known
    • getContentType

      default org.springframework.util.MimeType getContentType()
      Get the resource content type.
      Returns:
      the content type, never null
    • asMap

      default Map<String,?> asMap()
      Get the metadata as a map of key-value pairs.

      Implementing classes are free to return a map with arbitrary keys.

      Returns:
      a map of the metadata values
    • populateMap

      default void populateMap(Map<String,Object> map)
      Populate a map with all available metadata key-value pairs.

      Any existing values in map will be overwritten by keys from this instance.

      Parameters:
      map - the map to populate
    • asStandardMap

      default Map<String,?> asStandardMap()
      Get the metadata as a map of key-value pairs, excluding any custom metadata properties so that only standard metadata values are included.
      Returns:
      a map of the standard metadata values
    • asCustomMap

      default Map<String,?> asCustomMap()
      Get the metadata as a map of key-value pairs, excluding any standard metadata properties so that only custom metadata values are included.
      Returns:
      a map of the custom metadata values
    • isCustomKey

      default boolean isCustomKey(String key)
      Test if a metadata map key is standard or custom.
      Parameters:
      key - the metadata key to test
      Returns:
      true if key represents a custom metadata key, false if it represents a standard metadata key