ElegantJ Data Tables Java API Specification v1.1

com.elegantj.data.dataprovider.ftp
Class FTPTextDataProvider

java.lang.Object
  extended bycom.elegantj.data.dataprovider.AbstractDataProvider
      extended bycom.elegantj.data.dataprovider.text.TextDataProvider
          extended bycom.elegantj.data.dataprovider.ftp.FTPTextDataProvider
All Implemented Interfaces:
DataProvider, java.io.Externalizable, java.io.Serializable

public class FTPTextDataProvider
extends TextDataProvider
implements java.io.Externalizable

This class encapsulates functionality of an FTP text data provider.
The basic functionality can be summarized as follows:
- Connect to FTP Server by specifying host, port, username and password.
- Retrieve the data and store it in text data provider or save the data to
the remote file on FTP Server.
- Close the connection.
This bean provides powerful designing aspects by providing following user friendly property.
DataProvider the data provider
File the path of the remote file
RowSeparator the row separator string
ColumnSeparator the column separator string
TextQualifier the text qualifier string
FirstRowAsColumnNames indicates whether the first row of the retrieved data is column names or not
ColumnsDelimited indicates whether the columns are delimited or fixed width
SkippedColumns the comma separated indexes of the columns to be skipped
ColumnsWidth the comma separated width of the columns
SortCriteria the criteria for sorting the data
FilterCriteria the criteria for filtering the data
FilterState indicates whether the filter criteria is applied or not
SaveOnlyFilteredData indicates to save only filtered rows or all rows
FetchSize the maximum number of rows which can be retrieved
AppendDataOnFetchNext indicates whether the next fetched data is appended or replaced to existing data
SkippedRows the total number of rows to be skipped
HostName the name or IP address of the remote host
Port the FTP port number
UserName the name of the FTP user
Password the password associated with the FTP user

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.elegantj.data.dataprovider.text.TextDataProvider
DEFAULT_COLUMN_SEPARATOR, DEFAULT_ROW_SEPARATOR, DEFAULT_TEXT_QUALIFIER, forInput, in, out
 
Fields inherited from class com.elegantj.data.dataprovider.AbstractDataProvider
c1, changes, clientTable, columnNames, currentIndex, dataTable
 
Constructor Summary
FTPTextDataProvider()
           
 
Method Summary
 void changeToParentDirectory()
          Changes to remote parent directory.
 void changeWorkingDirectory(java.lang.String remotePath)
          Changes a working remote directory.
 boolean close()
          Closes input / output stream of the text file
 boolean connect()
          Connects to FTP server.
 boolean disconnect()
          Disconnects from FTP server.
 java.lang.String getCurrentWorkingDirectory()
          Returns name of current working remote directory.
 java.lang.String getFileList()
          Returns a list of files in current working remote directory.
 java.lang.String getHostName()
          Returns the FTP Server host name.
 java.lang.String getPassword()
          Returns the password.
 int getPort()
          Returns the FTP port.
 java.lang.String getUserName()
          Returns the username.
 boolean open(boolean input)
          Opens input stream or output stream of the text file
 void readExternal(java.io.ObjectInput in)
           
 void retrieveDataFromServer(java.lang.String remotePath)
          Retrieves the data from the remote file on FTP Server.
 void saveDataToServer(java.lang.String remoteFile)
          Saves the data to remote file on FTP Server.
 void setHostName(java.lang.String newHost)
          Sets the FTP Server host name.
 void setPassword(java.lang.String newPassword)
          Sets the password to logging into FTP Server.
 void setPort(int newPort)
          Sets the FTP port.
 void setURL(java.lang.String fileURL)
          Not applicable
 void setURLConnectionEnabled(boolean b)
          Not applicable
 void setUserName(java.lang.String newUser)
          Sets the username to logging into FTP Server.
 void writeExternal(java.io.ObjectOutput out)
          Externalizable interface implementation to save and retrieve the state of this bean
 
Methods inherited from class com.elegantj.data.dataprovider.text.TextDataProvider
getFile, getSkippedColumns, getURL, isFetchNext, isURLConnectionEnabled, nextData, retrieve, retrieveData, save, saveData, setFile, setSkippedColumns
 
Methods inherited from class com.elegantj.data.dataprovider.AbstractDataProvider
addDataListener, addPropertyChangeListener, addRow, appendData, dataChanged, dataChanged, deleteRow, equals, exportToSQL, exportToSQL, exportToSQL, exportToSQL, exportToText, exportToText, exportToText, exportToText, exportToXML, exportToXML, filterData, find, find, findNext, fireDataChanged, firePropertyChange, firstRecord, getColumnCount, getColumnIndex, getColumnNames, getColumnsArray, getColumnSeparator, getColumnsWidth, getColumnTag, getColumnType, getComputable, getCurrentIndex, getCurrentRecord, getData, getDataAt, getDataAt, getDataCount, getDataProvider, getDeletedCount, getFetchSize, getFilterCriteria, getFilteredCount, getLicenseKey, getModifiedCount, getRootTag, getRowSeparator, getRowTag, getSkippedRows, getSortColumns, getSortCriteria, getTextQualifier, insertDataAt, isAppendDataOnFetchNext, isColumnsDelimited, isFilterState, isFirstRowAsColumnNames, isSaveOnlyFilteredData, lastRecord, modifyDataAt, nextRecord, parseInt, previousRecord, refreshData, removeAll, removeAt, removeDataListener, removePropertyChangeListener, removeRange, rollbackModifications, saveModifications, scrollToRow, setAppendDataOnFetchNext, setColumnsDelimited, setColumnSeparator, setColumnsWidth, setColumnTag, setData, setDataArray, setDataProvider, setFetchSize, setFilterCriteria, setFilterState, setFirstRowAsColumnNames, setLicenseKey, setRootTag, setRowSeparator, setRowTag, setSaveOnlyFilteredData, setSkippedRows, setSortCriteria, setTextQualifier, sortData, sortData, sortData, sortData, sortData, sortData, sortData, sortData, sortData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FTPTextDataProvider

public FTPTextDataProvider()
Method Detail

setURL

public void setURL(java.lang.String fileURL)
Not applicable

Overrides:
setURL in class TextDataProvider
Parameters:
fileURL - the URL of the text file

setURLConnectionEnabled

public void setURLConnectionEnabled(boolean b)
Not applicable

Overrides:
setURLConnectionEnabled in class TextDataProvider
Parameters:
b - true to enable the URL connection

open

public boolean open(boolean input)
Opens input stream or output stream of the text file

Overrides:
open in class TextDataProvider
Parameters:
input - true to open the input stream, false to open the output stream
Returns:
true if the connection is successfully opened, otherwise false

close

public boolean close()
Closes input / output stream of the text file

Overrides:
close in class TextDataProvider
Returns:
true if the connection is successfully closed, otherwise false

connect

public boolean connect()
Connects to FTP server.

Returns:
true if successfully connected to FTP Server, false otherwise.

disconnect

public boolean disconnect()
Disconnects from FTP server.

Returns:
true if successfully disconnected to FTP Server, false otherwise.

changeWorkingDirectory

public void changeWorkingDirectory(java.lang.String remotePath)
Changes a working remote directory.


retrieveDataFromServer

public void retrieveDataFromServer(java.lang.String remotePath)
Retrieves the data from the remote file on FTP Server.

Parameters:
remotePath - The path of the remote file on FTP Server.

saveDataToServer

public void saveDataToServer(java.lang.String remoteFile)
Saves the data to remote file on FTP Server. in the text data provider.

Parameters:
remoteFile - The path of the remote file on FTP Server.

changeToParentDirectory

public void changeToParentDirectory()
Changes to remote parent directory.


getFileList

public java.lang.String getFileList()
Returns a list of files in current working remote directory.

Returns:
The file listing in current working directory.

getCurrentWorkingDirectory

public java.lang.String getCurrentWorkingDirectory()
Returns name of current working remote directory.

Returns:
The name of current working remote directory.

setHostName

public void setHostName(java.lang.String newHost)
Sets the FTP Server host name.

Parameters:
newHost - The FTP Server host name.

getHostName

public java.lang.String getHostName()
Returns the FTP Server host name.

Returns:
The FTP Server host name.

setPort

public void setPort(int newPort)
Sets the FTP port.

Parameters:
newPort - The FTP port.

getPort

public int getPort()
Returns the FTP port.

Returns:
The FTP port.

setUserName

public void setUserName(java.lang.String newUser)
Sets the username to logging into FTP Server.

Parameters:
newUser - The username to logging into FTP Server.

getUserName

public java.lang.String getUserName()
Returns the username.

Returns:
The username.

setPassword

public void setPassword(java.lang.String newPassword)
Sets the password to logging into FTP Server.

Parameters:
newPassword - The password to logging into FTP Server.

getPassword

public java.lang.String getPassword()
Returns the password.

Returns:
The password.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Externalizable interface implementation to save and retrieve the state of this bean

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class TextDataProvider
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class TextDataProvider
Throws:
java.io.IOException
java.lang.ClassNotFoundException

ElegantJ Data Tables Java API Specification v1.1

Submit a bug or feature

Copyright(c)
Elegant Microweb Technologies Pvt. Ltd.
www.elegantmicroweb.com
www.elegantjbeans.com
All Rights Reserved.