Package org.opencastproject.mediapackage
Interface MediaPackageElementBuilder
- All Known Implementing Classes:
AttachmentBuilderPlugin,MediaPackageElementBuilderImpl
public interface MediaPackageElementBuilder
A media package element builder provides factory methods for the creation and loading of media package elements from
files.
-
Method Summary
Modifier and TypeMethodDescriptionelementFromManifest(Node elementNode, MediaPackageSerializer serializer) Creates a media package element from the DOM element.elementFromURI(URI uri) Creates a media package element from the given file that was previously accepted.elementFromURI(URI uri, MediaPackageElement.Type type, MediaPackageElementFlavor flavor) Creates a media package element from the given file that was previously accepted, whiletypeandflavormay be taken as strong hints and may both benull.newElement(MediaPackageElement.Type type, MediaPackageElementFlavor flavor) Creates a new media package elment of the specified type.
-
Method Details
-
elementFromURI
Creates a media package element from the given file that was previously accepted.Since only the file is given, it is possible, that the best builder plugin cannot be uniquely identified and may require additional contraints, e. g. a matching filename. Be sure to check the documentation of the corresponding plugin for details.
- Parameters:
uri- the element location- Returns:
- the new media package element
- Throws:
UnsupportedElementException- if creating the media package element fails
-
elementFromURI
MediaPackageElement elementFromURI(URI uri, MediaPackageElement.Type type, MediaPackageElementFlavor flavor) throws UnsupportedElementException Creates a media package element from the given file that was previously accepted, whiletypeandflavormay be taken as strong hints and may both benull.If only the file is given, it is possible, that the best suited builder plugin cannot be uniquely identified and may require additional contraints, e. g. a matching filename. Be sure to check the documentation of the corresponding builder plugin for details.
- Parameters:
uri- the element locationtype- the element typeflavor- the element flavor- Returns:
- the new media package element
- Throws:
UnsupportedElementException- if creating the media package element fails
-
elementFromManifest
MediaPackageElement elementFromManifest(Node elementNode, MediaPackageSerializer serializer) throws UnsupportedElementException Creates a media package element from the DOM element.- Parameters:
elementNode- the DOM nodeserializer- the media package serializer- Returns:
- the media package element
- Throws:
UnsupportedElementException- if reading the file from manifest fails
-
newElement
Creates a new media package elment of the specified type.- Parameters:
type- the element typeflavor- the element flavor- Returns:
- the new media package element
-