Package org.ctan.site.resources.admin
Class CrudUpload3Resource
java.lang.Object
org.ctan.site.resources.admin.CrudUpload3Resource
@Path("/3.0/admin")
@Produces("application/json")
@RolesAllowed("ADMIN")
public class CrudUpload3Resource
extends Object
The class
CrudUpload3Resource contains the CRUD controller for
the upload resource.-
Constructor Summary
ConstructorsConstructorDescriptionCrudUpload3Resource(@NonNull UploadStore store) This is the constructor for the classCrudUpload3Resource. -
Method Summary
Modifier and TypeMethodDescriptionThe methodcreateprovides an end-point to create an upload.The methodretrieveprovides means to retrieve a upload.The methodlistprovides means to retrieve a page of uploads.booleanThe methodremoveprovides an end-point to remove a user.
-
Constructor Details
-
CrudUpload3Resource
This is the constructor for the classCrudUpload3Resource.- Parameters:
store- the underlying store
-
-
Method Details
-
create
The methodcreateprovides an end-point to create an upload.- Parameters:
upload- the upload object to store- Returns:
- the updated entity
-
get
@GET @Path("/upload/{id}") @UnitOfWork("siteDb") public Upload get(@NonNull @PathParam("id") @NonNull Long id) The methodretrieveprovides means to retrieve a upload.- Parameters:
id- the id- Returns:
trueiff the upload exists
-
list
@GET @Path("/uploads") @UnitOfWork("siteDb") public GeneralPage list(@QueryParam("q") String q, @DefaultValue("1") @QueryParam("page") int page, @DefaultValue("64") @QueryParam("size") int size, @QueryParam("order") String orderBy, @QueryParam("asc") boolean asc) The methodlistprovides means to retrieve a page of uploads.- Parameters:
q- the name patternpage- the pagesize- the page sizeorderBy- the orderasc- the indicator for ascending- Returns:
- the page for the user or
null
-
remove
@DELETE @Path("/upload/{id}") @UnitOfWork("siteDb") public boolean remove(@NonNull @PathParam("id") @NonNull Long id) The methodremoveprovides an end-point to remove a user.- Parameters:
id- the id- Returns:
trueiff the user has existed
-