Package org.ctan.site.resources.content
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 Summary
ConstructorsConstructorDescriptionContent3Resource
(@NonNull ContentService service, @NonNull LionService lionService) This is the constructor for the classContent3Resource
. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
The methodgetImage
provides means to retrieve an image from the content area.byte[]
getLionFile
(String name) The methodgetLionFile
provides means to retrieve a lion image.The methodgetPage
provides means to retrieve a HTML page from the content area.getPageList
(String lang, String path) The methodgetPageList
provides means to retrieve a listing from the content area.getPageTree
(String path, String lang, Integer depth) The methodgetPageTree
provides means to retrieve a listing from the content area.byte[]
getTeaserForPkg
(String key) The methodgetTeaserForPkg
provides means to retrieve a teaser image from the content area.byte[]
getTeaserForTopic
(String key) The methodgetTeaserForTopic
provides means to retrieve a teaser image from the content area.The methodgetVersion
provides means to retrieve the version number of the API.The methodlistLionDir
provides means to retrieve the directory listing or the lion files.
-
Constructor Details
-
Content3Resource
public Content3Resource(@NonNull @NonNull ContentService service, @NonNull @NonNull LionService lionService) This is the constructor for the classContent3Resource
.- Parameters:
service
- the underlying servicelionService
- 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 methodgetImage
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 methodgetLionFile
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 methodgetPage
provides means to retrieve a HTML page from the content area.- Parameters:
lang
- the ISO language codepath
- 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 methodgetPageList
provides means to retrieve a listing from the content area.- Parameters:
lang
- the ISO language codepath
- 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 methodgetPageTree
provides means to retrieve a listing from the content area.- Parameters:
path
- the path in the TeX archivelang
- the ISO language codedepth
- the number of levels to include- Returns:
- the list of files found
-
getVersion
The methodgetVersion
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
The methodlistLionDir
provides means to retrieve the directory listing or the lion files.- Returns:
- the directory listing
-