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 Details

    • CrudUpload3Resource

      public CrudUpload3Resource(@NonNull @NonNull UploadStore store)
      This is the constructor for the class CrudUpload3Resource.
      Parameters:
      store - the underlying store
  • Method Details

    • create

      @POST @Path("/upload") @UnitOfWork("siteDb") public Upload create(@NonNull @NonNull Upload upload)
      The method create provides 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 method retrieve provides means to retrieve a upload.
      Parameters:
      id - the id
      Returns:
      true iff 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 method list provides means to retrieve a page of uploads.
      Parameters:
      q - the name pattern
      page - the page
      size - the page size
      orderBy - the order
      asc - 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 method remove provides an end-point to remove a user.
      Parameters:
      id - the id
      Returns:
      true iff the user has existed