Interface ObjectStorageEntry<O>

Type Parameters:
O - Cloud vendor-specific response object.
All Known Implementing Classes:
AwsS3ObjectStorageEntry, AzureBlobStorageEntry, GoogleCloudStorageEntry, LocalStorageEntry, OracleCloudStorageEntry

public interface ObjectStorageEntry<O>
Object storage entry.
Since:
1.0
Author:
Pavol Gressa
  • Method Details

    • getKey

      @NonNull @NonNull String getKey()
      The object path on object storage. For example /path/to
      Returns:
      object path or empty string if the object is placed at the root of bucket
    • getInputStream

      @NonNull @NonNull InputStream getInputStream()
      Returns:
      The object content.
    • getNativeEntry

      @NonNull O getNativeEntry()
      Returns:
      The underlying cloud vendor-specific response object.
    • getMetadata

      @NonNull default @NonNull Map<String,String> getMetadata()
      Returns:
      a map with key-value pairs that were stored along the file. An empty map by default.
      Since:
      1.1.0
    • getContentType

      @NonNull default @NonNull Optional<String> getContentType()
      Returns:
      the MIME type of the entry.
      Since:
      1.1.0
    • toStreamedFile

      @NonNull default @NonNull io.micronaut.http.server.types.files.StreamedFile toStreamedFile()
      Returns:
      a StreamedFile from this entry.
      Since:
      1.1.0
    • toSystemFile

      @NonNull default @NonNull io.micronaut.http.server.types.files.SystemFile toSystemFile()
      Returns:
      a SystemFile from this entry. Note that calling this method will consume the getInputStream(), which will be closed.
      Since:
      1.1.0