0

I have a Java app that queries a file database. Depending on the query, I get a set of results (files) ranked in a certain order. I got this to work locally, and the user can open those files by double-clicking on the results, one by one. Now, I am moving everything to an external server, and I have the Java program query the database on the server. I get the same results back. Now, the files are also stored on the server, they are not local, so, when the user double-clicks, I need to do some secure ftp (or something similar, I can take suggestions) to copy the file and open it locally (and, if desired, save it). This is the problem, I have no idea where to start, is there a good Java library I should use, look at, in order to accomplish this? Username and password for the ftp can be hard-coded if necessary, should this make things any easier (though it's probably the same). FYI the files are mostly pdf, html, word or text, not binary. Thanks!

user
  • 2,015
  • 6
  • 22
  • 39

2 Answers2

1

Not sure about your business requirements and constraints, but you can look at the Dropbox API for Java. This could be either a slick suggestion or a terrible one depending on your needs.

riddle_me_this
  • 8,575
  • 10
  • 55
  • 80
1

As @MadProgrammer suggested JSch

Refer to following post already answering your concern :

java-what-is-the-best-way-to-sftp-a-file-from-a-server

Community
  • 1
  • 1