org.gcube.datatransformation.datatransformationlibrary.programs
Class File2FileProgram

java.lang.Object
  extended by org.gcube.datatransformation.datatransformationlibrary.programs.Elm2ElmProgram
      extended by org.gcube.datatransformation.datatransformationlibrary.programs.File2FileProgram
All Implemented Interfaces:
Program

public abstract class File2FileProgram
extends Elm2ElmProgram

Author:
Dimitris Katris, NKUA

Abstract helper class that implements the Program interface.

Each class that extends the P2PProgram shall implement the File2FileProgram#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 Summary
File2FileProgram()
           
 
Method Summary
 DataElement transformDataElement(DataElement sourceDataElement, List<Parameter> programParameters, ContentType targetContentType)
          Transforms the sourceDataElement to the targetContentType and returns the transformed DataElement.
abstract  File transformFile(File sourceFile, List<Parameter> programParameters, ContentType targetContentType, String targetContentPath)
          Transforms the content of the sourceFile file to the targetContentType and returns the transformed content in a file.
 
Methods inherited from class org.gcube.datatransformation.datatransformationlibrary.programs.Elm2ElmProgram
transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

File2FileProgram

public File2FileProgram()
Method Detail

transformDataElement

public DataElement transformDataElement(DataElement sourceDataElement,
                                        List<Parameter> programParameters,
                                        ContentType targetContentType)
                                 throws Exception
Description copied from class: Elm2ElmProgram
Transforms the sourceDataElement to the targetContentType and returns the transformed DataElement.

Specified by:
transformDataElement in class Elm2ElmProgram
Parameters:
sourceDataElement - The source DataElement.
programParameters - The parameters of the Program.
targetContentType - The ContentType in which the DataElement will be transformed.
Returns:
The transformed DataElement.
Throws:
Exception - If the Program is not capable to transform DataElements.
See Also:
Elm2ElmProgram.transformDataElement(org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement, java.util.List, org.gcube.datatransformation.datatransformationlibrary.model.ContentType)

transformFile

public abstract File transformFile(File sourceFile,
                                   List<Parameter> programParameters,
                                   ContentType targetContentType,
                                   String targetContentPath)
                            throws Exception
Transforms the content of the sourceFile file to the targetContentType and returns the transformed content in a file.

Parameters:
sourceFile - The source file.
programParameters - The parameters of the Program.
targetContentType - The ContentType in which the DataElement will be transformed.
targetContentPath - The path for the transformed content.
Returns:
The file of the transformed content.
Throws:
Exception - If the Program is not capable to transform DataElements.


Copyright © 2013. All Rights Reserved.