I'm new using CXF and Spring to make RESTful webservices. The project is under maven control.
I have a android app that would like to connect to the server retrieving book information and cover picture via RESTful webservices. Is it possible (and how) RESTful service return an image?
Project Explorer
Project
--Java Resource
----src/main/java
------library.service
--------IBook.java
--------Book.java
----images
------Cover1.png
------Cover2.png
--JavaResources
--Deployed Resources
----webapp
------WEB-INF
----web-resources
IBook.java interface
@GET
@Path("/book/cover/{name}")
@Produces("image/png")
public Image getImage(@PathParam("name") String name);
Book.java impl
public Image getImage(String name){
//How should I get cover png from 'images' folder and return it??
}
Thanks
Silvester Pang