[teiid-issues] [JBoss JIRA] (TEIID-4441) Add FTP/SFTP based access to the File Resource Adapter

Kylin Soong (JIRA) issues at jboss.org
Sun Dec 18 22:18:00 EST 2016


    [ https://issues.jboss.org/browse/TEIID-4441?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13339949#comment-13339949 ] 

Kylin Soong commented on TEIID-4441:
------------------------------------

I have concern of how to to implement the FTP VirtualFile, need your weight.

Current FTP VirtualFile not reference a real physic file, rather than reference a Inputstream, which opened by FTP session(FTPClient), but FTPClient.retrieveFileStream must be call complete command after stream be closed:
{code}
FTPClient client = ...
try {
InputStream in = client.retrieveFileStream("pathToFile");
...
in.close()
} finally {
client.completePendingCommand();
}
{code}

More details from [1], especially the sentence "To finalize the file transfer you must call completePendingCommand and check its return value to verify success"

So if we create a JDBC connection, try to open more stream, there will be a error throw, I think my initial thoughts that cache ftp file to local tmp filesystem may be good solution for this issue.

[1] http://commons.apache.org/proper/commons-net/apidocs/org/apache/commons/net/ftp/FTPClient.html#retrieveFileStream(java.lang.String)

> Add FTP/SFTP based access to the File Resource Adapter
> ------------------------------------------------------
>
>                 Key: TEIID-4441
>                 URL: https://issues.jboss.org/browse/TEIID-4441
>             Project: Teiid
>          Issue Type: Enhancement
>          Components: Misc. Connectors
>            Reporter: Ramesh Reddy
>            Assignee: Kylin Soong
>             Fix For: Open To Community, 9.2
>
>
> This has been requested few times in the community, it would be nice to give provide this functionality.  Using http://commons.apache.org/proper/commons-net/ seems to be right decision.



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the teiid-issues mailing list