org.gcube.datatransformation.datatransformationlibrary.dataelements.impl
Class LocalFileDataElement

java.lang.Object
  extended by org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement
      extended by org.gcube.datatransformation.datatransformationlibrary.dataelements.impl.LocalFileDataElement

public class LocalFileDataElement
extends DataElement

Author:
Dimitris Katris, NKUA Implementation of DataElement class in which the content is kept in a local file.

Field Summary
 
Fields inherited from class org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement
attributes
 
Constructor Summary
LocalFileDataElement()
           
 
Method Summary
 void destroy()
           
 InputStream getContent()
          Abstract method which returns the content of the DataElement in a stream.
 ContentType getContentType()
          Returns the ContentType of the DataElement.
 File getFileContent()
          Returns the content as file.
static LocalFileDataElement getSinkDataElement(DataElement sourceDataElement)
          Returns a new LocalFileDataElement which contains all the attributes taken from the source DataElement.
static LocalFileDataElement getSourceDataElement()
          Returns a new LocalFileDataElement.
 void setContent(File file)
          Sets the file which contains the content of the DataElement.
 
Methods inherited from class org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement
deleteAttribute, getAllAttributes, getAttributeValue, getId, setAttribute, setContentType, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalFileDataElement

public LocalFileDataElement()
Method Detail

setContent

public void setContent(File file)
Sets the file which contains the content of the DataElement.

Parameters:
file - The content of the DataElement.

getContent

public InputStream getContent()
Description copied from class: DataElement
Abstract method which returns the content of the DataElement in a stream.

Specified by:
getContent in class DataElement
Returns:
The content of the DataElement.
See Also:
DataElement.getContent()

getFileContent

public File getFileContent()
Returns the content as file.

Returns:
The content as file.

getContentType

public ContentType getContentType()
Description copied from class: DataElement
Returns the ContentType of the DataElement.

Overrides:
getContentType in class DataElement
Returns:
The ContentType of the DataElement.
See Also:
DataElement.getContentType()

getSourceDataElement

public static LocalFileDataElement getSourceDataElement()
Returns a new LocalFileDataElement.

Returns:
The new LocalFileDataElement.

getSinkDataElement

public static LocalFileDataElement getSinkDataElement(DataElement sourceDataElement)
Returns a new LocalFileDataElement which contains all the attributes taken from the source DataElement.

Parameters:
sourceDataElement - The DataElement from which the new one inherits all attributes.
Returns:
The new LocalFileDataElement.

destroy

public void destroy()
Specified by:
destroy in class DataElement


Copyright © 2013. All Rights Reserved.