public class BlobManagerComponent extends DefaultComponent implements BlobManager
Blob
s, through internally-registered
BlobProvider
s.Modifier and Type | Class and Description |
---|---|
protected static class |
BlobManagerComponent.BlobProviderDescriptorRegistry |
BlobManager.UsageHint
Modifier and Type | Field and Description |
---|---|
protected BlobManagerComponent.BlobProviderDescriptorRegistry |
blobProviderDescriptorsRegistry |
protected Map<String,BlobProvider> |
blobProviders |
protected static String |
XP |
lastModified
Constructor and Description |
---|
BlobManagerComponent() |
Modifier and Type | Method and Description |
---|---|
protected void |
closeOldBlobProvider(String id)
We're about to change something about a contributed blob provider.
|
void |
deactivate(ComponentContext context)
Deactivates the component.
|
Map<String,URI> |
getAvailableConversions(Blob blob,
BlobManager.UsageHint hint)
Gets a map of available MIME type conversions and corresponding
URI for a blob. |
BlobProvider |
getBlobProvider(Blob blob)
Gets the blob provider for the given blob.
|
BlobProvider |
getBlobProvider(String providerId)
Gets the blob provider with the given id.
|
Map<String,BlobProvider> |
getBlobProviders()
Get the map of blob providers
|
InputStream |
getStream(Blob blob)
INTERNAL - Gets an
InputStream for the data of a managed blob. |
InputStream |
getThumbnail(Blob blob)
Gets an
InputStream for a thumbnail of a blob. |
URI |
getURI(Blob blob,
BlobManager.UsageHint hint,
javax.servlet.http.HttpServletRequest servletRequest)
Gets an
URI for the content of a blob. |
void |
registerBlobProvider(BlobProviderDescriptor descr) |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
unregisterBlobProvider(BlobProviderDescriptor descr) |
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
activate, getAdapter, getLastModified, registerExtension, setLastModified, setModifiedNow, start, stop, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
protected static final String XP
protected BlobManagerComponent.BlobProviderDescriptorRegistry blobProviderDescriptorsRegistry
protected Map<String,BlobProvider> blobProviders
public BlobManagerComponent()
public void deactivate(ComponentContext context)
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
public void registerBlobProvider(BlobProviderDescriptor descr)
public void unregisterBlobProvider(BlobProviderDescriptor descr)
protected void closeOldBlobProvider(String id)
public BlobProvider getBlobProvider(String providerId)
BlobManager
getBlobProvider
in interface BlobManager
providerId
- the blob provider idpublic BlobProvider getBlobProvider(Blob blob)
BlobManager
getBlobProvider
in interface BlobManager
public InputStream getStream(Blob blob) throws IOException
BlobManager
InputStream
for the data of a managed blob. Used by internal implementations, regular
callers should call Blob.getStream()
.getStream
in interface BlobManager
blob
- the blobIOException
public InputStream getThumbnail(Blob blob) throws IOException
BlobManager
InputStream
for a thumbnail of a blob.
Like all InputStream
, the result must be closed when done with it to avoid resource leaks.
getThumbnail
in interface BlobManager
blob
- the blobIOException
public URI getURI(Blob blob, BlobManager.UsageHint hint, javax.servlet.http.HttpServletRequest servletRequest) throws IOException
BlobManager
URI
for the content of a blob.getURI
in interface BlobManager
blob
- the blobhint
- BlobManager.UsageHint
servletRequest
- the servlet request, or null
URI
, or null
if none availableIOException
public Map<String,URI> getAvailableConversions(Blob blob, BlobManager.UsageHint hint) throws IOException
BlobManager
URI
for a blob.getAvailableConversions
in interface BlobManager
URI
, which may be emptyIOException
public Map<String,BlobProvider> getBlobProviders()
BlobManager
getBlobProviders
in interface BlobManager
Copyright © 2018 Nuxeo. All rights reserved.