I am trying to return a REST service to a zip file from a local hard drive. The following is what I do
@Path("/interface3/{Ent_id}/{esf_app_id}/{esf_app_ver}") public class Interface3Mock { // This method is called if TEXT_PLAIN is request @GET @Produces("application/zip") public Response callInterface3_text( @PathParam("Ent_id") Integer entitlement_id, @PathParam("eapp_id") String eapp_id, @PathParam("eapp_ver") String eapp_ver) { File f = new File("D:\\Documentation\\Documentation.zip"); String mt = new MimetypesFileTypeMap().getContentType(f); return Response.ok(f, mt).build(); } }
Now when I use the browser, i.e. Internet Explorer and the key in the URL http://localhost:9788/mockRESTServer/rest/interface3/123456/k123/l345 I see a file download dialog box that says: "You want to save the l345` file.
I want him to ask me to download zip, i.e. D:\\Documentation\\Documentation.zip . But for some reason, it takes the last parameter in the request URL.
source share