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 TypeMethodDescriptionjakarta.ws.rs.core.ResponseThe methodgetImageprovides means to retrieve an image from the content area.jakarta.ws.rs.core.ResponsegetLionFile(String name) The methodgetLionFileprovides means to retrieve a lion image.The methodgetPageprovides means to retrieve a HTML page from the content area.getPageList(String lang, String path) The methodgetPageListprovides means to retrieve a listing from the content area.getPageTree(String path, String lang, Integer depth) The methodgetPageTreeprovides means to retrieve a listing from the content area.byte[]getTeaserForPkg(String key) The methodgetTeaserForPkgprovides means to retrieve a teaser image from the content area.byte[]getTeaserForTopic(String key) The methodgetTeaserForTopicprovides means to retrieve a teaser image from the content area.The methodgetVersionprovides means to retrieve the version number of the API.The methodlistLionDirprovides 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 jakarta.ws.rs.core.Response getImage(@PathParam("path") String path) The methodgetImageprovides 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 jakarta.ws.rs.core.Response getLionFile(@PathParam("name") String name) The methodgetLionFileprovides 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 methodgetPageprovides 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 methodgetPageListprovides 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 methodgetPageTreeprovides 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 methodgetVersionprovides means to retrieve the version number of the API.- Returns:
- a Map with a single attribute
versioncontaining the version number as String.
-
listLionDir
The methodlistLionDirprovides means to retrieve the directory listing or the lion files.- Returns:
- the directory listing
-