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

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

public class URLDataElement
extends DataElement
implements java.io.Serializable

Author:
Dimitris Katris, NKUA

DataElement whose content is accessible from a url connection.


Constructor Summary
URLDataElement(java.lang.String url)
          Instantiates a new URLDataElement.
 
Method Summary
 void destroy()
           
 java.io.InputStream getContent()
           
 ContentType getContentType()
           
static URLDataElement getSourceDataElement()
          Instantiates and returns a new URLDataElement.
 void setContent(java.net.URL url)
          Sets the content of the URLDataElement.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLDataElement

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

Parameters:
url - The url with the content.
Throws:
java.lang.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 java.io.InputStream getContent()
Returns:
The content of the DataElement.
See Also:
org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement#getContent()

setContent

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

Parameters:
url - The content of the URLDataElement.

getContentType

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

destroy

public void destroy()