Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.api.externalblob
Interface ExternalBlobAdapter

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractExternalBlobAdapter, FileSystemExternalBlobAdapter

public interface ExternalBlobAdapter
extends Serializable

Interface to implement when defining a way to get a Blob that is not stored at the usual place handled by the repository.

This is done storing a string instead of a blob, using a prefix that makes it possible to find the adapter in charge of retrieving the file. It makes it also possible to use the same adapter implementation for different configurations, in conjunction with properties.

The string will look something like "fs:file/foo.odt", "fs" being the prefix, and "file/foo.odt" being the local name, with all the needed information to retrieve the actual file for this adapter.

Author:
Anahide Tchertchian

Field Summary
static String PREFIX_SEPARATOR
           
 
Method Summary
 Blob getBlob(String uri)
          Retrieves the blob for given uri.
 String getPrefix()
          Returns the prefix to use as marker for this adapter
 Map<String,String> getProperties()
          Return specific properties for this adapter.
 String getProperty(String name)
          Return property with gievn name.
 void setPrefix(String prefix)
          Sets the prefix to use as marker for this adapter
 void setProperties(Map<String,String> properties)
          Set specific properties for this adapter.
 

Field Detail

PREFIX_SEPARATOR

static final String PREFIX_SEPARATOR
See Also:
Constant Field Values
Method Detail

getPrefix

String getPrefix()
Returns the prefix to use as marker for this adapter


setPrefix

void setPrefix(String prefix)
Sets the prefix to use as marker for this adapter


getProperties

Map<String,String> getProperties()
Return specific properties for this adapter. Can be used for whatever useful property.


getProperty

String getProperty(String name)
Return property with gievn name.

Returns null if no property value is found.


setProperties

void setProperties(Map<String,String> properties)
Set specific properties for this adapter. Can be used for whatever useful property.


getBlob

Blob getBlob(String uri)
             throws PropertyException
Retrieves the blob for given uri.

Parameters:
uri - the uri describing what adapter handles the file and the needed info to retrieve it.
Returns:
the resolved blob.
Throws:
PropertyException - if the blob cannot be retrieved (if adapter cannot retrieve it or if file is not found for instance)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.