public abstract class P2PProgram extends Stream2StreamProgram
Abstract helper class that implements the Program interface.
Each class that extends the P2PProgram shall implement the P2PProgram#transformObjectFromItsPath(String, List, ContentType) method which takes as input a file location and returns the location of a file which contains the transformed content.
| Constructor and Description |
|---|
P2PProgram() |
| Modifier and Type | Method and Description |
|---|---|
abstract String |
transformObjectFromItsPath(String sourceContentPath,
List<Parameter> progparameters,
ContentType targetContentType,
String targetContentPath)
Transforms the content of a file whose location is contentpath to the targetContentType and returns the transformed content in a file.
|
InputStream |
transformStream(InputStream content,
ContentType sourceFormat,
List<Parameter> progparameters,
ContentType targetContentType)
Transforms the content to the targetContentType and returns the transformed content as a stream.
|
transformDataElementtransformpublic InputStream transformStream(InputStream content, ContentType sourceFormat, List<Parameter> progparameters, ContentType targetContentType) throws Exception
Stream2StreamProgramtransformStream in class Stream2StreamProgramcontent - The content of the source DataElement.sourceFormat - The ContentType of the source DataElement.progparameters - 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.Stream2StreamProgram.transformStream(java.io.InputStream, org.gcube.datatransformation.datatransformationlibrary.model.ContentType, java.util.List, org.gcube.datatransformation.datatransformationlibrary.model.ContentType)public abstract String transformObjectFromItsPath(String sourceContentPath, List<Parameter> progparameters, ContentType targetContentType, String targetContentPath) throws Exception
sourceContentPath - The location of the source file.progparameters - The parameters of the Program.targetContentType - The ContentType in which the DataElement will be transformed.targetContentPath - The path for the transformed content.Exception - If the Program is not capable to transform DataElements.Copyright © 2014. All Rights Reserved.