Class Content3Resource

java.lang.Object
org.ctan.site.resources.content.Content3Resource

@Path("/3.0") @Produces({"application/json","application/xml"}) public class Content3Resource extends Object
The class Content3Resource contains the controller for the content resource.
  • Constructor Details

    • Content3Resource

      public Content3Resource(@NonNull @NonNull ContentService service, @NonNull @NonNull LionService lionService)
      This is the constructor for the class Content3Resource.
      Parameters:
      service - the underlying service
      lionService - the service for the lion files
  • Method Details

    • getImage

      @GET @Path("/content/img/{path: .*}") @Produces({"image/png","image/gif","image/jpeg"}) public byte[] getImage(@PathParam("path") String path)
      The method getImage provides means to retrieve an image from the content area.
      Parameters:
      path - the path in the content archive
      Returns:
      the data for the index file
    • getLionFile

      @GET @Path("/content/lion/file/{name}") @Produces({"image/png","image/tiff","application/postscript","text/plain"}) public byte[] getLionFile(@PathParam("name") String name)
      The method getLionFile provides means to retrieve a lion image.
      Parameters:
      name - the file name
      Returns:
      the content of the file
    • getPage

      @GET @Path("/content/page/{path: .*}") public ContentService.ContentPageTo getPage(@QueryParam("lang") String lang, @PathParam("path") String path)
      The method getPage provides means to retrieve a HTML page from the content area.
      Parameters:
      lang - the ISO language code
      path - the path in the content archive
      Returns:
      the data for the index file
    • getPageList

      @GET @Path("/content/list/{path: .*}") public ContentService.ContentPageTo getPageList(@QueryParam("lang") String lang, @PathParam("path") String path)
      The method getPageList provides means to retrieve a listing from the content area.
      Parameters:
      lang - the ISO language code
      path - the path in the Te X archive
      Returns:
      the list of files found
    • getPageTree

      @GET @Path("/content/tree/{path: .*}") public ContentService.ContentPageTreeTo getPageTree(@PathParam("path") String path, @QueryParam("lang") String lang, @QueryParam("depth") @DefaultValue("2") Integer depth)
      The method getPageTree provides means to retrieve a listing from the content area.
      Parameters:
      path - the path in the TeX archive
      lang - the ISO language code
      depth - the number of levels to include
      Returns:
      the list of files found
    • getTeaserForPkg

      @GET @Path("/teaser/pkg/{key}") @Produces({"image/png","image/gif","image/jpeg"}) public byte[] getTeaserForPkg(@PathParam("key") String key)
      The method getTeaserForPkg provides means to retrieve a teaser image from the content area.
      Parameters:
      key - the key of the package
      Returns:
      the data for the image file
    • getTeaserForTopic

      @GET @Path("/teaser/topic/{key}") @Produces({"image/png","image/gif","image/jpeg"}) public byte[] getTeaserForTopic(@PathParam("key") String key)
      The method getTeaserForTopic provides means to retrieve a teaser image from the content area.
      Parameters:
      key - the key of the package
      Returns:
      the data for the image file
    • getVersion

      @GET @Path("/content/version") public Map<String,String> getVersion()
      The method getVersion provides means to retrieve the version number of the API.
      Returns:
      a Map with a single attribute version containing the version number as String.
    • listLionDir

      @GET @Path("/content/lion") public LionService.FileListTo listLionDir()
      The method listLionDir provides means to retrieve the directory listing or the lion files.
      Returns:
      the directory listing