0


I'm planning to setup an Enterprise application where the Java standalone client can upload and download .doc and .odt documents from an application server (WildFly). I'm evaluating different solutions such as:

  1. Using a Servlet as bridge to upload documents and download using an HttpConnection.
  2. Using a REST Web service to upload and download the document
  3. Using an EJB and passing the document as argument and returning the document from the EJB call

I think all of the above solutions should somehow work, but which is more fit for a Desktop application, which also needs some level of authentication during the communication? Thanks

user2824073
  • 2,407
  • 10
  • 39
  • 73
  • 1
    If you only want to offer access to the documents via your client application, REST would be a good solution. If you think about having a WebUI too, Servlets would do the job. – Korashen Sep 10 '14 at 08:01
  • 1
    I found Jersey to be a bit difficult to work with file uploads but you can try the apache fileupload project – arisalexis Sep 10 '14 at 08:07

1 Answers1

2

I agree all of the above solutions should work, however instead of using plain Servlets, why not using HttpClient libraries from Apache which make fairly simple to upload and download files ? There is even a library written on the top of HttpClient which is named Awake file which is opensource and allows secure upload and download of documents from Java Desktop applications and Android clients as well. Hope it helps

Francesco Marchioni
  • 4,091
  • 1
  • 25
  • 40
  • Thanks for your reply. I managed to set up quickily Awake file. It seems quite interesting solution so I'll try it as first option. – user2824073 Sep 10 '14 at 08:50