public class BinaryBlobProvider extends Object implements BlobProvider
BinaryManager
and a BlobProvider
for the BlobManager
.
Can be used by legacy implementations of a BinaryManager
to provide a BlobProvider
implementation.
Modifier and Type | Field and Description |
---|---|
protected BinaryManager |
binaryManager |
protected boolean |
supportsUserUpdate |
Constructor and Description |
---|
BinaryBlobProvider(BinaryManager binaryManager) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the adapted
BinaryManager . |
BinaryManager |
getBinaryManager()
Gets the associated binary manager, if any.
|
void |
initialize(String blobProviderId,
Map<String,String> properties)
Initializes the blob provider.
|
Blob |
readBlob(BlobManager.BlobInfo blobInfo)
Reads a
Blob from storage. |
boolean |
supportsUserUpdate()
Checks if user update is supported.
|
protected boolean |
supportsUserUpdateDefaultTrue(Map<String,String> properties) |
String |
writeBlob(Blob blob,
Document doc)
Writes a
Blob to storage and returns information about it. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
freezeVersion, getAppLinks, getAvailableConversions, getConvertedStream, getStream, getThumbnail, getURI, isVersion
protected final BinaryManager binaryManager
protected boolean supportsUserUpdate
public BinaryBlobProvider(BinaryManager binaryManager)
public void initialize(String blobProviderId, Map<String,String> properties) throws IOException
BlobProvider
initialize
in interface BlobProvider
blobProviderId
- the blob provider id for this binary managerproperties
- initialization propertiesIOException
public boolean supportsUserUpdate()
BlobProvider
A user update refers to the fact that a blob from this provider may be overwritten with another blob, wherever the original blob may occur (usually in a document property).
supportsUserUpdate
in interface BlobProvider
true
if user update is supportedprotected boolean supportsUserUpdateDefaultTrue(Map<String,String> properties)
public void close()
BinaryManager
.close
in interface BlobProvider
public BinaryManager getBinaryManager()
BlobProvider
getBinaryManager
in interface BlobProvider
null
public Blob readBlob(BlobManager.BlobInfo blobInfo) throws IOException
BlobProvider
Blob
from storage.readBlob
in interface BlobProvider
blobInfo
- the blob informationIOException
public String writeBlob(Blob blob, Document doc) throws IOException
BlobProvider
Blob
to storage and returns information about it.
Called to store a user-created blob.
writeBlob
in interface BlobProvider
blob
- the blobdoc
- the document to which this blob belongsIOException
Copyright © 2015 Nuxeo SA. All rights reserved.