org.gcube.datatransformation.datatransformationlibrary.datahandlers.impl
Class FTPDataSource

java.lang.Object
  extended by org.gcube.datatransformation.datatransformationlibrary.datahandlers.impl.FTPDataSource

public class FTPDataSource
extends java.lang.Object

Author:
Dimitris Katris, NKUA

This DataSource fetches DataElements from an ftp site.


Constructor Summary
FTPDataSource()
          Instantiates an FTPDataSource object.
FTPDataSource(java.lang.String input, Parameter[] inputParameters)
           
 
Method Summary
 void close()
           
 DataElement getDataElement(java.lang.String dataElementID)
           
 java.lang.String getNextDataElementID()
           
 boolean hasNext()
           
 void initializeDistributableDataSource(java.lang.String input, Parameter[] inputParameters)
           
 boolean isClosed()
           
static void main(java.lang.String[] args)
          Tests ftp data source and sink.
 DataElement next()
           
 ContentType nextContentType()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FTPDataSource

public FTPDataSource(java.lang.String input,
                     Parameter[] inputParameters)
              throws java.lang.Exception
Parameters:
input - The input value of the DataSource.
inputParameters - The input parameters of the DataSource.
Throws:
java.lang.Exception - If a connection could not be established.

FTPDataSource

public FTPDataSource()
Instantiates an FTPDataSource object.

Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Tests ftp data source and sink.

Parameters:
args - The arguments of the main.
Throws:
java.lang.Exception - If an error occurred in the test.

hasNext

public boolean hasNext()
Returns:
true if the DataSource has more elements.
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataSource#hasNext()

next

public DataElement next()
Returns:
the next element of the DataSource.
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataSource#next()

close

public void close()
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataHandler#close()

isClosed

public boolean isClosed()
Returns:
true if the DataHandler has been closed.
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DataHandler#isClosed()

getDataElement

public DataElement getDataElement(java.lang.String dataElementID)
                           throws java.lang.Exception
Parameters:
dataElementID - The id of the DataElement.
Returns:
The DataElement instance.
Throws:
java.lang.Exception - If an error occurred in getting the DataElement.
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DistributableDataSource#getDataElement(java.lang.String)

getNextDataElementID

public java.lang.String getNextDataElementID()
                                      throws java.lang.Exception
Returns:
The next data element id.
Throws:
java.lang.Exception - If the DistributableDataSource did not manage to get another data element id.
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DistributableDataSource#getNextDataElementID()

initializeDistributableDataSource

public void initializeDistributableDataSource(java.lang.String input,
                                              Parameter[] inputParameters)
                                       throws java.lang.Exception
Parameters:
input - The input of the DistributableDataSource
inputParameters - Any input parameters required by the DistributableDataSource.
Throws:
java.lang.Exception - If the DistributableDataSource could not be initialized.
See Also:
org.gcube.datatransformation.datatransformationlibrary.datahandlers.DistributableDataSource#initializeDistributableDataSource(java.lang.String, org.gcube.datatransformation.datatransformationlibrary.model.Parameter[])

nextContentType

public ContentType nextContentType()