@Path(value="shops/{shopId}/products/{productId}/slideshow")
@RolesAllowed(value={"sf","products_read"})
public class SlideshowResource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private ServerConfiguration |
config |
private ProductImageService |
productImageService |
private SlideshowService |
slideshowService |
Constructor and Description |
---|
SlideshowResource(ServerConfiguration config,
SlideshowService slideshowService,
ProductImageService productImageService) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
deleteProductImage(java.lang.String shopId,
GUID productId,
java.lang.String imageName) |
private long |
getFileSizeFromHeaders(java.lang.Long contentSize,
org.glassfish.jersey.media.multipart.FormDataContentDisposition disposition) |
javax.ws.rs.core.Response |
getSlideshow(java.lang.String shopId,
GUID productId) |
javax.ws.rs.core.Response |
uploadProductImage(java.lang.String shopId,
GUID productId,
java.lang.Long contentSize,
java.io.InputStream imageInputStream,
org.glassfish.jersey.media.multipart.FormDataContentDisposition disposition) |
private final ServerConfiguration config
private final SlideshowService slideshowService
private final ProductImageService productImageService
@Inject public SlideshowResource(ServerConfiguration config, SlideshowService slideshowService, ProductImageService productImageService)
@GET @Produces(value="application/vnd.epages.v1+json, application/json") public javax.ws.rs.core.Response getSlideshow(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="productId") GUID productId)
@DELETE @Path(value="{imageName}") @RolesAllowed(value="products_write") public javax.ws.rs.core.Response deleteProductImage(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="productId") GUID productId, @PathParam(value="imageName") java.lang.String imageName)
@POST @Consumes(value="multipart/form-data") public javax.ws.rs.core.Response uploadProductImage(@PathParam(value="shopId") java.lang.String shopId, @PathParam(value="productId") GUID productId, @HeaderParam(value="content-length") java.lang.Long contentSize, java.io.InputStream imageInputStream, org.glassfish.jersey.media.multipart.FormDataContentDisposition disposition) throws java.io.IOException
contentSize
- The maximum size of the image. Three values are used to
determine whether the file should be rejected:
imageInputStream
- stream of the imagedisposition
- multipart header fieldsjava.io.IOException
ServerConfiguration.getMaxUploadSize()
private long getFileSizeFromHeaders(java.lang.Long contentSize, org.glassfish.jersey.media.multipart.FormDataContentDisposition disposition)