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

java.lang.Object
  extended by org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement
      extended by org.gcube.datatransformation.datatransformationlibrary.dataelements.impl.URLDataElement
All Implemented Interfaces:
Serializable

public class URLDataElement
extends org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement
implements Serializable

Author:
Dimitris Katris, NKUA

DataElement whose content is accessible from a url connection.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement
attributes
 
Constructor Summary
URLDataElement(String url)
          Instantiates a new URLDataElement.
 
Method Summary
 void destroy()
           
 InputStream getContent()
           
 org.gcube.datatransformation.datatransformationlibrary.model.ContentType getContentType()
           
static URLDataElement getSourceDataElement()
          Instantiates and returns a new URLDataElement.
 void setContent(URL url)
          Sets the content of the URLDataElement.
 
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

URLDataElement

public URLDataElement(String url)
               throws Exception
Instantiates a new URLDataElement.

Parameters:
url - The url with the content.
Throws:
Exception - If the url is not valid.
Method Detail

getSourceDataElement

public static URLDataElement getSourceDataElement()
Instantiates and returns a new URLDataElement.

Returns:
The new URLDataElement.

getContent

public InputStream getContent()
Specified by:
getContent in class org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement
Returns:
The content of the DataElement.
See Also:
DataElement.getContent()

setContent

public void setContent(URL url)
Sets the content of the URLDataElement.

Parameters:
url - The content of the URLDataElement.

getContentType

public org.gcube.datatransformation.datatransformationlibrary.model.ContentType getContentType()
Overrides:
getContentType in class org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement
Returns:
The ContentType of the URLDataElement.
See Also:
DataElement.getContentType()

destroy

public void destroy()
Specified by:
destroy in class org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement


Copyright © 2012. All Rights Reserved.