public abstract class ExternalBinaryValue extends AbstractBinary
BinaryValue
implementation that represents a binary value that resides outside of ModeShape's
binary store. Typically this will be subclasses by Connector
implementations that wish to provide their own binariesEMPTY_CONTENT
Modifier | Constructor and Description |
---|---|
protected |
ExternalBinaryValue(BinaryKey key,
String sourceName,
String id,
long size,
String nameHint,
MimeTypeDetector mimeTypeDetector)
Creates a new instance, with the given params
|
Modifier and Type | Method and Description |
---|---|
String |
getId()
Returns this binary's source-specific identifier.
|
String |
getMimeType() |
String |
getMimeType(String name) |
long |
getSize()
Get the length of this binary data.
|
String |
getSourceName()
Returns the name of the external source, to which this binary belongs.
|
protected boolean |
hasMimeType() |
protected void |
setMimeType(String mimeType) |
String |
toString() |
compareTo, dispose, equals, getHash, getHexHash, getKey, getReadableSize, getStream, hashCode, internalStream, keyFor, read
protected ExternalBinaryValue(BinaryKey key, String sourceName, String id, long size, String nameHint, MimeTypeDetector mimeTypeDetector)
key
- the binary key, never null
sourceName
- name of the external source which owns the value, never null
id
- the source-specific identifier of the binary, never null
size
- the length of the binarynameHint
- optional name which can help with mime-type detectionmimeTypeDetector
- the repository's MimeTypeDetector
public String getId()
public String getSourceName()
protected void setMimeType(String mimeType)
protected boolean hasMimeType()
public String getMimeType()
public long getSize()
BinaryValue
Note that this method, unlike the standard Binary.getSize()
method, does not throw an exception.
public String toString()
toString
in class AbstractBinary
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.