Package org.faceless.publisher.type
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 TypeMethodDescriptionlongReturn the byte-length of this attachment, or -1 if can't be determined yetdefault byte[]getBytes()Return a copy of the byte datalongReturn the creation date of this Blob in milliseconds since the epoch, or 0 if not known.default EmbeddedFilegetEmbeddedFile(String name) 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 InputSourceReturn a new InputSource based on the character data if the charset is known, or the byte data otherwise.Retun a newInputStreamto read from this BloblongReturn the modification date of this Blob in milliseconds since the epoch, or 0 if not known.Return theMediaTypeof this Blob, or MediaType.WILDCARD if not known.default ReaderReturn a new Reader for the character data, which will be UTF-8 if the charset is not set in the MediaTypedefault SourcegetSource(ReportFactory factory) Return a new Source based on the character data if a charset is known, or the byte data otherwise.default StringReturn the content of this Blob as a String, based on the byte data and the#getEncodinggetURL()Return the URL2 associated with this Blob, ornullif unspecified.booleanReturn true if the data in this blobs should be considered trusted.
-
Method Details
-
getMediaType
MediaType getMediaType()Return theMediaTypeof this Blob, or MediaType.WILDCARD if not known. Must not return null -
getInputStream
InputStream getInputStream()Retun a newInputStreamto read from this Blob -
getURL
URL2 getURL()Return the URL2 associated with this Blob, ornullif unspecified. The default implementation on this interface returnsnull -
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
Return a new Reader for the character data, which will be UTF-8 if the charset is not set in the MediaType -
getEmbeddedFile
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
Return a new InputSource based on the character data if the charset is known, or the byte data otherwise. -
getSource
Return a new Source based on the character data if a charset is known, or the byte data otherwise. -
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
-