|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.sswap.http.rest.DefaultResource
public class DefaultResource
A default, catch-all resource that is used to serve static content (e.g., man-pages) or to generate a 404 HTTP message if there is no other resource found.
Field Summary | |
---|---|
private static java.util.Map<java.lang.String,javax.ws.rs.core.MediaType> |
EXTENSION_MEDIA_TYPE_MAP
Maps extensions (lower case) onto corresponding MediaTypes |
private static org.apache.log4j.Logger |
LOGGER
The logger for the makeType task. |
private static java.lang.String |
MAN_PAGES_ROOT
The root of the man pages |
Constructor Summary | |
---|---|
DefaultResource()
|
Method Summary | |
---|---|
private static java.lang.String |
getExtension(java.lang.String path)
Gets the extension from the path |
javax.ws.rs.core.Response |
serve(java.lang.String path)
Produces the content of a static resource or NotFoundException if there is no corresponding resource |
static javax.ws.rs.core.Response |
serveStaticResource(java.lang.String path)
A static method for serving content (so that it can be called by other RESTful resources easily). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.log4j.Logger LOGGER
private static final java.lang.String MAN_PAGES_ROOT
private static final java.util.Map<java.lang.String,javax.ws.rs.core.MediaType> EXTENSION_MEDIA_TYPE_MAP
Constructor Detail |
---|
public DefaultResource()
Method Detail |
---|
public javax.ws.rs.core.Response serve(java.lang.String path)
path
- the value of the path URI parameterpublic static javax.ws.rs.core.Response serveStaticResource(java.lang.String path)
path
- the path to be served
private static java.lang.String getExtension(java.lang.String path)
path
- the path
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |