Hi all,

I 've added sftp support to the implementation [2] in order to get an idea
about how apache vfs is used in file transferring.I used
com.jcraft(jsch),apache.commons and commons-logging dependencies in the
implementation which you can find in the pom.
To run the program,

1.Add server details to the SFTPProperties.txt

serverAddress=[server address]
userId=[userId]
password=[user password]
remoteDirectory=[Remote folder name]/
localDirectory=/LocalSFTP/  *don't change this

You can simply setup a openssh sftp server [1] and add the credentials to
the txt file above mentioned
Your local file folder is LocalSFTP.Add files you want to exchange in that
folder.
Your remote file folder is [Remote folder name](You can create a folder
with a name you preferred in the server)

2. Build the pom.xml
3. Run the scripts SFTPDownload.java and SFTPUpload.java

[1]
http://askubuntu.com/questions/420652/how-to-setup-a-restricted-sftp-server-on-ubuntu
[2] https://github.com/hasithajayasundara/Simple-FTP-client-and-server

On Mon, Mar 13, 2017 at 7:16 PM, Hasitha Jayasundara <
[email protected]> wrote:

> Hi Malaka,
>
> No need to install any Server locally.You can find the server
> implementation in FTPServer.java.
>
> 1. Run FTPServer.java
> 2. Run FTPClient.java
> 3. In the folders Client and Server include the files you need to exchange.
> (Change file paths according to your development environment
>       eg - File f=new File("Add your file path/Client/"+fileName);
>              File f=new File("Add your file path/Server/"+fileName);)
> 4.In FTPClient.java console you can find
>   1.SendFile
>   2.ReceiveFile
>
> Include the number of the operation you need.(eg - 1 for SendFile, 2 for
> ReceiveFile ).And you can see it's working.(Include files inside Client and
> Server folders.Otherwise the console would outputs "File not found").
>
> On Mon, Mar 13, 2017 at 6:09 PM, Malaka Silva <[email protected]> wrote:
>
>> +Kevin
>>
>> On Mon, Mar 13, 2017 at 6:09 PM, Malaka Silva <[email protected]> wrote:
>>
>>> Hi Hasitha,
>>>
>>> How did you test the sample?
>>>
>>> Did you install a FTP/SFTP server locally and try this use case?
>>>
>>> On Mon, Mar 13, 2017 at 8:05 AM, Hasitha Jayasundara <
>>> [email protected]> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I have implemented a simple FTP client and server using Java [1] to get
>>>> a better understanding and trying to extend this to support SFTP also. Will
>>>> update the implementation with new technologies and mechanisms found.
>>>>
>>>> [1] https://github.com/hasithajayasundara/Simple-FTP-client-and-server
>>>>
>>>> On Wed, Mar 8, 2017 at 9:54 PM, Hasitha Jayasundara <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Vivekanthan,
>>>>>
>>>>> I'll go through this and let you know if there's any issue.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> On Wed, Mar 8, 2017 at 9:28 PM, Vivekananthan Sivanayagam <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> ​
>>>>>> ​Hi Hasitha,
>>>>>>
>>>>>> ​you can refer the existing file connector​[1]​ which used the Apache
>>>>>> Commons VFS I/O functionalities​ to get an idea of the file operation
>>>>>> ​s​
>>>>>> when implementing ​
>>>>>> ​the ​
>>>>>> connector for FTP/SFTP​​
>>>>>> ​.
>>>>>>
>>>>>> [1]
>>>>>> https://docs.wso2.com/display/ESBCONNECTORS/Working+with+the
>>>>>> +File+Connector+Version+2
>>>>>> ​
>>>>>>
>>>>>> Thanks,
>>>>>> Vivek.​
>>>>>> ​
>>>>>>
>>>>>> Vivekananthan Sivanayagam
>>>>>> Associate Software Engineer | WSO2
>>>>>> E:[email protected]
>>>>>> M:+94752786138 <+94%2075%20278%206138>
>>>>>>
>>>>>> On Wed, Mar 8, 2017 at 8:00 PM, Malaka Silva <[email protected]> wrote:
>>>>>>
>>>>>>> Hi Hasitha,
>>>>>>>
>>>>>>> Good to hear. Keep us posted.
>>>>>>>
>>>>>>> On Wed, Mar 8, 2017 at 7:18 PM, Hasitha Jayasundara <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> Hi Malaka,
>>>>>>>>
>>>>>>>> Sorry for the late reply.
>>>>>>>>
>>>>>>>> I studied the implementation of ESB connectors[1],File Inbound
>>>>>>>> protocol [2] and now I have a fully understanding about the project 
>>>>>>>> and the
>>>>>>>> deliverables. As the description of the project states I'll update the
>>>>>>>> thread with my findings on methods to to be used for file operations 
>>>>>>>> via
>>>>>>>> ftp/sftp other than Apache-vfs.
>>>>>>>>
>>>>>>>> (I do confirm that I am a full time student and eligible to
>>>>>>>> participate GSoC)
>>>>>>>>
>>>>>>>> [1] https://docs.wso2.com/display/ESBCONNECTORS/WSO2+ESB+Connectors
>>>>>>>> [2] https://docs.wso2.com/display/ESB500/File+Inbound+Protocol
>>>>>>>>
>>>>>>>>
>>>>>>>> *D.M.Hasitha Nadishan Jayasundara*
>>>>>>>> *Department of Electronic and Telecommunication Engineering*
>>>>>>>> University of Moratuwa
>>>>>>>> *mobile:* *+94711959266 <071%20195%209266>*
>>>>>>>> *blogspot*: learnjavawithisla.blogspot.com/  *email:*
>>>>>>>> [email protected]
>>>>>>>> <https://www.facebook.com/hasitha.nadishan.3>
>>>>>>>> <https://twitter.com/HNadishan>
>>>>>>>> <https://lk.linkedin.com/in/hasithajayasundara>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> Best Regards,
>>>>>>>
>>>>>>> Malaka Silva
>>>>>>> Associate Director / Architect
>>>>>>> M: +94 777 219 791 <+94%2077%20721%209791>
>>>>>>> Tel : 94 11 214 5345
>>>>>>> Fax :94 11 2145300 <011%202%20145300>
>>>>>>> Skype : malaka.sampath.silva
>>>>>>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>>>>>>> Blog : http://mrmalakasilva.blogspot.com/
>>>>>>>
>>>>>>> WSO2, Inc.
>>>>>>> lean . enterprise . middleware
>>>>>>> https://wso2.com/signature
>>>>>>> http://www.wso2.com/about/team/malaka-silva/
>>>>>>> <http://wso2.com/about/team/malaka-silva/>
>>>>>>> https://store.wso2.com/store/
>>>>>>>
>>>>>>> Don't make Trees rare, we should keep them with care
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Dev mailing list
>>>>>>> [email protected]
>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *D.M.Hasitha Nadishan Jayasundara*
>>>>> *Department of Electronic and Telecommunication Engineering*
>>>>> University of Moratuwa
>>>>> *mobile:* *+94711959266 <+94%2071%20195%209266>*
>>>>> *blogspot*: learnjavawithisla.blogspot.com/  *email:*
>>>>> [email protected]
>>>>> <https://www.facebook.com/hasitha.nadishan.3>
>>>>> <https://twitter.com/HNadishan>
>>>>> <https://lk.linkedin.com/in/hasithajayasundara>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> *D.M.Hasitha Nadishan Jayasundara*
>>>> *Department of Electronic and Telecommunication Engineering*
>>>> University of Moratuwa
>>>> *mobile:* *+94711959266 <071%20195%209266>*
>>>> *blogspot*: learnjavawithisla.blogspot.com/  *email:*
>>>> [email protected]
>>>> <https://www.facebook.com/hasitha.nadishan.3>
>>>> <https://twitter.com/HNadishan>
>>>> <https://lk.linkedin.com/in/hasithajayasundara>
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> Best Regards,
>>>
>>> Malaka Silva
>>> Associate Director / Architect
>>> M: +94 777 219 791 <077%20721%209791>
>>> Tel : 94 11 214 5345
>>> Fax :94 11 2145300 <011%202%20145300>
>>> Skype : malaka.sampath.silva
>>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>>> Blog : http://mrmalakasilva.blogspot.com/
>>>
>>> WSO2, Inc.
>>> lean . enterprise . middleware
>>> https://wso2.com/signature
>>> http://www.wso2.com/about/team/malaka-silva/
>>> <http://wso2.com/about/team/malaka-silva/>
>>> https://store.wso2.com/store/
>>>
>>> Don't make Trees rare, we should keep them with care
>>>
>>
>>
>>
>> --
>>
>> Best Regards,
>>
>> Malaka Silva
>> Associate Director / Architect
>> M: +94 777 219 791 <+94%2077%20721%209791>
>> Tel : 94 11 214 5345
>> Fax :94 11 2145300
>> Skype : malaka.sampath.silva
>> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
>> Blog : http://mrmalakasilva.blogspot.com/
>>
>> WSO2, Inc.
>> lean . enterprise . middleware
>> https://wso2.com/signature
>> http://www.wso2.com/about/team/malaka-silva/
>> <http://wso2.com/about/team/malaka-silva/>
>> https://store.wso2.com/store/
>>
>> Don't make Trees rare, we should keep them with care
>>
>
>
>
> --
> *D.M.Hasitha Nadishan Jayasundara*
> *Department of Electronic and Telecommunication Engineering*
> University of Moratuwa
> *mobile:* *+94711959266 <+94%2071%20195%209266>*
> *blogspot*: learnjavawithisla.blogspot.com/  *email:* hasithajayasundar
> [email protected]
> <https://www.facebook.com/hasitha.nadishan.3>
> <https://twitter.com/HNadishan>
> <https://lk.linkedin.com/in/hasithajayasundara>
>



-- 
*D.M.Hasitha Nadishan Jayasundara*
*Department of Electronic and Telecommunication Engineering*
University of Moratuwa
*mobile:* *+94711959266*
*blogspot*: learnjavawithisla.blogspot.com/  *email:*
[email protected]
<https://www.facebook.com/hasitha.nadishan.3>
<https://twitter.com/HNadishan>
<https://lk.linkedin.com/in/hasithajayasundara>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to