Class Blob

All Implemented Interfaces:

public class Blob extends Object implements AbstractBlob
A general purpose blob of data which can be text or binary. To override, pass in a null byte[] and override getInputStream
  • Constructor Details

  • Method Details

    • setCreationDate

      public void setCreationDate(long date)
      Set the (optional) creation date.
      date - the creation date in milliseconds since the UNIX epoch, or 0 to mark as unset (the default)
    • setAttachmentFileName

      public void setAttachmentFileName(String name)
      Set the (optional) filename set from the Content-Disposition header
    • getURL

      public URL2 getURL()
      Return the URL as set in the constructor, which may be null
      Specified by:
      getURL in interface AbstractBlob
    • getAttachmentFileName

      public String getAttachmentFileName()
      Return the filename as set by setAttachmentFileName
    • getMediaType

      public MediaType getMediaType()
      Return the MediaType, which will be set to WILDCARD if it was given as null;
      Specified by:
      getMediaType in interface AbstractBlob
    • getInputStream

      public InputStream getInputStream()
      Return a new InputStream for the byte data
      Specified by:
      getInputStream in interface AbstractBlob
    • getReader

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

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

      public Source getSource()
      Return a new Source based on the character data if a charset is known, or the byte data otherwise.
    • getEmbeddedFile

      public EmbeddedFile getEmbeddedFile(String name)
      Return a new PDF EmbeddedFile based on the blob;
      name - the name to use, will override the attachment name if specified
    • getBytes

      public byte[] getBytes()
      Return a copy of the byte data
    • isCharsetSpecified

      public boolean isCharsetSpecified()
      Return true if a charset was specified.
    • getString

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

      public long getLastModified()
      Return the last-modified time as milliseconds since the UNIX Epoch if specified, or 0 otherwise
      Specified by:
      getLastModified in interface AbstractBlob
    • getCreationDate

      public long getCreationDate()
      Return the creation time as milliseconds since the UNIX Epoch if specified, or 0 otherwise. This is set by setCreationDate(long)
      Specified by:
      getCreationDate in interface AbstractBlob
    • byteLength

      public long byteLength()
      Description copied from interface: AbstractBlob
      Return the byte-length of this attachment, or -1 if can't be determined yet
      Specified by:
      byteLength in interface AbstractBlob
    • toString

      public String toString()
      toString in class Object