Interface ConvertedMediaCreationStrategy

    • Method Detail

      • createOrUpdate

        MediaModel createOrUpdate​(MediaModel parent,
                                  ConversionMediaFormatModel format,
                                  java.io.InputStream content)
                           throws MediaIOException
        Creates a new media which was converted from the given parent by successful conversion to the given format or updates the corresponding media if it already exists. The passed InputStream content must be used to load the media's data.

        The MediaService is passed to avoid circular dependencies.

        Parameters:
        parent - the media the to-be-created media was converted from. This model should be set as the newly created media's parent.
        format - the format of the to-be-created media. This object should be set as the newly created media's format.
        content - InputStream holding the converted content.
        Returns:
        a new MediaModel
        Throws:
        MediaIOException - on any technical error when loading the contents