Package org.nuxeo.ecm.platform.io.api
Class AbstractIOResourceAdapter
- java.lang.Object
-
- org.nuxeo.ecm.platform.io.api.AbstractIOResourceAdapter
-
- All Implemented Interfaces:
Serializable,IOResourceAdapter
- Direct Known Subclasses:
IOAuditAdapter,IORelationAdapter
public abstract class AbstractIOResourceAdapter extends Object implements IOResourceAdapter
Abstract implementation forIOResourceAdapter.Offers helper methods for properties.
- Author:
- Anahide Tchertchian
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Serializable>properties
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractIOResourceAdapter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract IOResourcesextractResources(String repo, Collection<DocumentRef> sources)Extracts resources for given document locations.protected booleangetBooleanProperty(String propName)Map<String,Serializable>getProperties()Returns properties.abstract voidgetResourcesAsXML(OutputStream out, IOResources newResources)Export resources as XML.protected String[]getStringArrayProperty(String propName)protected StringgetStringProperty(String propName)abstract IOResourcesloadResourcesFromXML(InputStream stream)Returns resources built from given stream.protected voidsetBooleanProperty(String propName, Serializable propValue)voidsetProperties(Map<String,Serializable> properties)Set properties.protected voidsetStringArrayProperty(String propName, Serializable propValue)protected voidsetStringProperty(String propName, Serializable propValue)abstract voidstoreResources(IOResources newResources)Persists resources.abstract IOResourcestranslateResources(String repo, IOResources resources, DocumentTranslationMap map)Returns translated resources once copy has been done, passing a correspondence map.
-
-
-
Field Detail
-
properties
protected Map<String,Serializable> properties
-
-
Method Detail
-
getProperties
public Map<String,Serializable> getProperties()
Description copied from interface:IOResourceAdapterReturns properties.- Specified by:
getPropertiesin interfaceIOResourceAdapter
-
setProperties
public void setProperties(Map<String,Serializable> properties)
Description copied from interface:IOResourceAdapterSet properties.- Specified by:
setPropertiesin interfaceIOResourceAdapter
-
extractResources
public abstract IOResources extractResources(String repo, Collection<DocumentRef> sources)
Description copied from interface:IOResourceAdapterExtracts resources for given document locations.- Specified by:
extractResourcesin interfaceIOResourceAdapter- Parameters:
repo- TODOsources- locations of documents to consider. Has to include documents children if needed.- Returns:
- a structure holding associated resources.
-
translateResources
public abstract IOResources translateResources(String repo, IOResources resources, DocumentTranslationMap map)
Description copied from interface:IOResourceAdapterReturns translated resources once copy has been done, passing a correspondence map.- Specified by:
translateResourcesin interfaceIOResourceAdapter- Parameters:
repo- target repository for resources.resources- resources previously extracted thanks toIOResourceAdapter.extractResources(String, Collection)map- correspondence map between old locations and new ones.- Returns:
- translated resources.
-
storeResources
public abstract void storeResources(IOResources newResources)
Description copied from interface:IOResourceAdapterPersists resources.- Specified by:
storeResourcesin interfaceIOResourceAdapter- Parameters:
newResources- resources previously extracted thanks toIOResourceAdapter.extractResources(String, Collection)orIOResourceAdapter.translateResources(String, IOResources, DocumentTranslationMap)
-
getResourcesAsXML
public abstract void getResourcesAsXML(OutputStream out, IOResources newResources)
Description copied from interface:IOResourceAdapterExport resources as XML.- Specified by:
getResourcesAsXMLin interfaceIOResourceAdapter- Parameters:
out- stream where export will be written.newResources- resources previously extracted thanks toIOResourceAdapter.extractResources(String, Collection)orIOResourceAdapter.translateResources(String, IOResources, DocumentTranslationMap)
-
loadResourcesFromXML
public abstract IOResources loadResourcesFromXML(InputStream stream)
Description copied from interface:IOResourceAdapterReturns resources built from given stream.- Specified by:
loadResourcesFromXMLin interfaceIOResourceAdapter
-
getBooleanProperty
protected boolean getBooleanProperty(String propName)
-
setBooleanProperty
protected void setBooleanProperty(String propName, Serializable propValue)
-
setStringProperty
protected void setStringProperty(String propName, Serializable propValue)
-
setStringArrayProperty
protected void setStringArrayProperty(String propName, Serializable propValue)
-
-