Package org.ametys.plugins.contentio.in
Interface ContentImporter
- All Superinterfaces:
Prioritizable
- All Known Subinterfaces:
XmlContentImporter
- All Known Implementing Classes:
AbstractContentImporter
,AbstractXmlContentImporter
,DefaultXmlContentImporter
Interface representing a component which imports contents from a file.
-
Method Summary
Modifier and TypeMethodDescriptionimportContents
(InputStream is, Map<String, Object> params) Import the contents from the file.boolean
supports
(InputStream is, String name) Tests if theContentImporter
is able to import the corresponding stream.
Implementing classes should first test the file extension, if possible, and if the name is provided.Methods inherited from interface org.ametys.runtime.plugin.component.Prioritizable
getPriority
-
Method Details
-
supports
Tests if theContentImporter
is able to import the corresponding stream.
Implementing classes should first test the file extension, if possible, and if the name is provided.- Parameters:
is
- an input stream on the file, cannot be null. The stream is closed by the caller.name
- the file name, can be null.- Returns:
- true if the
ContentImporter
can import the corresponding stream, false otherwise. - Throws:
IOException
- if an error occurs.
-
importContents
Import the contents from the file.- Parameters:
is
- an input stream on the file, cannot be null. The stream is closed by the caller.params
- input or output parameters.- Returns:
- a Set of the imported content IDs.
- Throws:
IOException
- if an error occurs importing the contents.
-