Transfer files by FTP to Java Hosting

3

If I hire a host to host my Java application can I transfer files by ftp ? so that my application will read these files?

I have a desktop application that stays on the server that generates a .xml file every 1 hour and I have a web application that reads these files. However as a company security rules I can not make a direct connection between the web system and the server, I was told that a safer way to do this is to pass these files .xml to ftp so that the web system can read them. Is this possible?

    
asked by anonymous 12.06.2015 / 21:46

1 answer

3

Yes, it is possible.

You should configure the ftp service on a server.

On the side of your Desktop client you should upload the file to the ftp server using one of many libraries for this (eg, FTPClient Apache Commons Net ).

On the server side you can, among other strategies, have schedulled batch processes to read these files. Java EE 7 has a dedicated API for batch processing , we also have the good and old Spring Batch .

PS: Company rules are company standards, however remember that using FTP does not make file transfer automatically secure ... A well-configured SFTP is an interesting alternative to a upload https, but in one way or another it will be necessary to control aspects such as authentication / authorization / audit, etc. Availability is also a challenge regardless of the protocol chosen (see the 8 fallacies of distributed computing ).

In one way or another, transferring files in a secure, cheap and reliable way is not easy ... It's no wonder that in the 21st century we still have VANs and EDI services being charged per kilobyte.

    
12.06.2015 / 22:51