Interface AbstractBlob

All Known Subinterfaces:
MailExtension.Message, org.faceless.publisher.ext.MailExtension.Part
All Known Implementing Classes:
Blob

public interface AbstractBlob
An generic "Blob" interface, which represents a resource that may be used by BFO Publisher. In most cases the Blob instance of this interface should be used
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Return the byte-length of this attachment, or -1 if can't be determined yet
    default byte[]
    Return a copy of the byte data
    long
    Return the creation date of this Blob in milliseconds since the epoch, or 0 if not known.
    default EmbeddedFile
    Return a new PDF EmbeddedFile based on the blob, or null if it should be created externally.
    Return the name that this Blob should use if it was to be attached to a PDF or saved to disk.
    default InputSource
    Return a new InputSource based on the character data if the charset is known, or the byte data otherwise.
    Retun a new InputStream to read from this Blob
    long
    Return the modification date of this Blob in milliseconds since the epoch, or 0 if not known.
    Return the MediaType of this Blob, or MediaType.WILDCARD if not known.
    default Reader
    Return a new Reader for the character data, which will be UTF-8 if the charset is not set in the MediaType
    default Source
    Return a new Source based on the character data if a charset is known, or the byte data otherwise.
    default String
    Return the content of this Blob as a String, based on the byte data and the #getEncoding
    Return the URL2 associated with this Blob, or null if unspecified.
    boolean
    Return true if the data in this blobs should be considered trusted.
  • Method Details

    • getMediaType

      MediaType getMediaType()
      Return the MediaType of this Blob, or MediaType.WILDCARD if not known. Must not return null
    • getInputStream

      InputStream getInputStream()
      Retun a new InputStream to read from this Blob
    • getURL

      URL2 getURL()
      Return the URL2 associated with this Blob, or null if unspecified. The default implementation on this interface returns null
    • byteLength

      long byteLength()
      Return the byte-length of this attachment, or -1 if can't be determined yet
    • isTrusted

      boolean isTrusted()
      Return true if the data in this blobs should be considered trusted. The default implementation returns false
      Since:
      1.3
      See Also:
    • getCreationDate

      long getCreationDate()
      Return the creation date of this Blob in milliseconds since the epoch, or 0 if not known. The default implementation on this interface returns 0
    • getLastModified

      long getLastModified()
      Return the modification date of this Blob in milliseconds since the epoch, or 0 if not known. The default implementation on this interface returns 0
    • getFilename

      String getFilename()
      Return the name that this Blob should use if it was to be attached to a PDF or saved to disk. The return value may be null, in which case the filename should be derived from the URL externally. The returned value is not guaranteed to be a legal filename on any filesystem, but should not contain slash characters, newlines etc
      Returns:
      the filename
    • getReader

      default Reader getReader()
      Return a new Reader for the character data, which will be UTF-8 if the charset is not set in the MediaType
    • getEmbeddedFile

      default EmbeddedFile getEmbeddedFile(String name)
      Return a new PDF EmbeddedFile based on the blob, or null if it should be created externally.
      Parameters:
      name - the name to use for the file (required)
    • getInputSource

      default InputSource getInputSource()
      Return a new InputSource based on the character data if the charset is known, or the byte data otherwise.
    • getSource

      default Source getSource(ReportFactory factory)
      Return a new Source based on the character data if a charset is known, or the byte data otherwise.
    • getString

      default String getString()
      Return the content of this Blob as a String, based on the byte data and the #getEncoding
    • getBytes

      default byte[] getBytes()
      Return a copy of the byte data