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 Details

    • supports

      boolean supports(InputStream is, String name) throws IOException
      Tests if the ContentImporter 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.