public abstract class Stream2StreamProgram extends Elm2ElmProgram
Abstract helper class that implements the Program interface.
Each class that extends the Stream2StreamProgram shall implement the transformStream(InputStream, ContentType, List, ContentType) method which takes as input an InputStream and returns an InputStream of the transformed content.
| Constructor and Description |
|---|
Stream2StreamProgram() |
| Modifier and Type | Method and Description |
|---|---|
DataElement |
transformDataElement(DataElement sourceDataElement,
List<Parameter> programParameters,
ContentType targetContentType)
Transforms the sourceDataElement to the targetContentType and returns the transformed DataElement.
|
abstract InputStream |
transformStream(InputStream content,
ContentType sourceContentType,
List<Parameter> programParameters,
ContentType targetContentType)
Transforms the content to the targetContentType and returns the transformed content as a stream.
|
transformpublic DataElement transformDataElement(DataElement sourceDataElement, List<Parameter> programParameters, ContentType targetContentType) throws Exception
Elm2ElmProgramtransformDataElement in class Elm2ElmProgramsourceDataElement - The source DataElement.programParameters - The parameters of the Program.targetContentType - The ContentType in which the DataElement will be transformed.Exception - If the Program is not capable to transform DataElements.Elm2ElmProgram.transformDataElement(org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement, java.util.List, org.gcube.datatransformation.datatransformationlibrary.model.ContentType)public abstract InputStream transformStream(InputStream content, ContentType sourceContentType, List<Parameter> programParameters, ContentType targetContentType) throws Exception
content - The content of the source DataElement.sourceContentType - The ContentType of the source DataElement.programParameters - The parameters of the Program.targetContentType - The ContentType in which the DataElement will be transformed.Exception - If the Program is not capable to transform DataElements.Copyright © 2014. All Rights Reserved.