Hi Resteasy players,

I just wrote a JAX-RS Webservice that produces application/octet-stream 
flow to allow download of a file.
When I access the service through firefox, I would like that the Save as 
dialog box proposes the name of the file as the default filename.

Any idea on how to do this with RestEasy ?
Here is my code snippet:

     public InputStream getItem(@Context HttpServletRequest request,
             @PathParam("repositoryName") String rawRepositoryName, 
@PathParam("workspaceName") String rawWorkspaceName,
             @PathParam("path") String path) throws JSONException, 
UnauthorizedException, RepositoryException {

         Repository repository = 
         Session session = repository.login(rawWorkspaceName);
         Node fileNode = session.getNode(path);

         Node jcrContent = fileNode.getNode("jcr:content");
         String fileName = fileNode.getName();
         logger.info("Downloading file {}", fileName);
         return jcrContent.getProperty("jcr:data").getBinary().getStream();


Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
Resteasy-users mailing list

Reply via email to