Package org.silverpeas.core.importexport
Interface Importer<T>
-
- Type Parameters:
T
- The type of the resource to import.
- All Known Subinterfaces:
ICalendarImporter
- All Known Implementing Classes:
ICal4JImporter
public interface Importer<T>
An importer of a resource encoded into a format of a given MIME type.All importers in Silverpeas should implement this interface. An importer in Silverpeas is defined for a specific type of resources and it has the responsibility to process the import of such types of resources from a specific format of given MIME type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
imports(ImportDescriptor descriptor, Consumer<T> consumer)
Imports a resource of Silverpeas serialized into a specific format of a given MIME type from either the reader or the input stream provided by the specified descriptor.
-
-
-
Method Detail
-
imports
void imports(ImportDescriptor descriptor, Consumer<T> consumer) throws ImportException
Imports a resource of Silverpeas serialized into a specific format of a given MIME type from either the reader or the input stream provided by the specified descriptor. The result of the import is then passed to the specified consumer.- Parameters:
descriptor
- the import descriptor that describes how the import has to be done.consumer
- the consumer that takes the resource that was decoded. It ends the import process by, for example, saving it into Silverpeas.- Throws:
ImportException
- when an unexpected error occurs while importing the resource.
-
-