Package org.ametys.plugins.contentio
Interface ContentImporter
-
- All Known Subinterfaces:
XmlContentImporter
- All Known Implementing Classes:
AbstractContentImporter
,AbstractXmlContentImporter
,CsvContentImporter
,DefaultXmlContentImporter
public interface ContentImporter
Interface representing a component which imports contents from a file.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getPriority()
Get the importer priority.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.
-
-
-
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.
-
getPriority
int getPriority()
Get the importer priority. A lower number means a higher priority.- Returns:
- the importer priority.
-
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.
-
-