org.modeshape.jcr.value.binary
Class ExternalBinaryValue
java.lang.Object
org.modeshape.jcr.value.binary.AbstractBinary
org.modeshape.jcr.value.binary.ExternalBinaryValue
- All Implemented Interfaces:
- Serializable, Comparable<BinaryValue>, Binary, BinaryValue
- Direct Known Subclasses:
- GitBinaryValue
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 binaries
- See Also:
- Serialized Form
ExternalBinaryValue
public ExternalBinaryValue(String id,
String sourceName,
long size,
String nameHint,
MimeTypeDetector mimeTypeDetector)
- Creates a new instance, with the given params
- Parameters:
id - the binary id, never nullsourceName - name of the external source which owns the value, never nullsize - the length of the binarynameHint - optional name which can help with mime-type detectionmimeTypeDetector - the repository's MimeTypeDetector
getId
public String getId()
- Returns this binary's id.
- Returns:
- a non-null string
getSourceName
public String getSourceName()
- Returns the name of the external source, to which this binary belongs.
- Returns:
- a non-null string
setMimeType
protected void setMimeType(String mimeType)
hasMimeType
protected boolean hasMimeType()
getMimeType
public String getMimeType()
getMimeType
public String getMimeType(String name)
getSize
public long getSize()
- Description copied from interface:
BinaryValue
- Get the length of this binary data.
Note that this method, unlike the standard Binary.getSize() method, does not throw an exception.
- Returns:
- the number of bytes in this binary data
toString
public String toString()
- Overrides:
toString in class AbstractBinary
Copyright © 2008-2013 JBoss, a division of Red Hat. All Rights Reserved.