Class BinaryQueryParameter

java.lang.Object
ch.tocco.nice2.persist.core.api.entity.Binary
ch.tocco.nice2.persist.core.impl.hibernate.legacy.BinaryQueryParameter
All Implemented Interfaces:
AutoCloseable

public class BinaryQueryParameter extends Binary
This is a dummy implementation of Binary which enables querying binary fields by hash.
  • Constructor Details

  • Method Details

    • openStream

      public InputStream openStream() throws IOException
      Description copied from class: Binary
      Open an input stream to read the data.
      Overrides:
      openStream in class Binary
      Throws:
      IOException
    • size

      public long size()
      Description copied from class: Binary
      Return the size of this binary in bytes.
      Overrides:
      size in class Binary
      Returns:
      The size of the binary in bytes or a value < 0 if the size is unknown.
    • getMimeType

      public String getMimeType()
      Overrides:
      getMimeType in class Binary
    • getFileExtension

      @Nullable public @Nullable String getFileExtension()
      Description copied from class: Binary
      Returns the file extension when available. The file extension can be more specific than the mime-type.
      Overrides:
      getFileExtension in class Binary
    • close

      public void close()
      Description copied from class: Binary
      Release any resources associated with this binary.
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class Binary
    • toString

      public String toString()
      Overrides:
      toString in class Binary
    • getBase64DataUri

      public String getBase64DataUri() throws IOException
      Overrides:
      getBase64DataUri in class Binary
      Returns:
      a String containing the base64 encoded binary as it might be used as src an img tag.
      Throws:
      IOException
    • getUrl

      @Nullable public @Nullable Binary.BinaryUrl getUrl(String contentDisposition)
      Overrides:
      getUrl in class Binary
    • mayBeStored

      public boolean mayBeStored()
      Overrides:
      mayBeStored in class Binary
      Returns:
      if false, this binary can only be used as query parameter and does not contain any data