Package org.ametys.plugins.contentio.in
Interface ContentImporter
-
- All Superinterfaces:
Prioritizable
- All Known Subinterfaces:
XmlContentImporter
- All Known Implementing Classes:
AbstractContentImporter
,AbstractXmlContentImporter
,DefaultXmlContentImporter
public interface ContentImporter extends Prioritizable
Interface representing a component which imports contents from a file.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<String>
importContents(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 Detail
-
supports
boolean supports(InputStream is, String name) throws IOException
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
Set<String> importContents(InputStream is, Map<String,Object> params) throws IOException
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.
-
-