public class LogviewerResponseBuilder extends Object
Modifier and Type | Method and Description |
---|---|
static javax.ws.rs.core.Response |
buildDownloadFile(String contentDispositionName,
File file,
com.codahale.metrics.Meter numFileDownloadExceptions)
Build a Response object representing download a file.
|
static javax.ws.rs.core.Response |
buildExceptionJsonResponse(Exception ex,
String callback)
Build a Response object representing exception, with JSON response.
|
static javax.ws.rs.core.Response |
buildResponsePageNotFound()
Build a Response object representing page not found.
|
static javax.ws.rs.core.Response |
buildResponseUnauthorizedUser(String user)
Build a Response object representing unauthorized user, with HTML response.
|
static javax.ws.rs.core.Response |
buildSuccessHtmlResponse(String content)
Build a Response object representing success response with HTML entity.
|
static javax.ws.rs.core.Response |
buildSuccessJsonResponse(Object entity,
String callback,
String origin)
Build a Response object representing success response with JSON entity.
|
static javax.ws.rs.core.Response |
buildUnauthorizedUserJsonResponse(String user,
String callback)
Build a Response object representing unauthorized user, with JSON response.
|
public static javax.ws.rs.core.Response buildSuccessHtmlResponse(String content)
Build a Response object representing success response with HTML entity.
content
- HTML entity content, String typepublic static javax.ws.rs.core.Response buildSuccessJsonResponse(Object entity, String callback, String origin)
Build a Response object representing success response with JSON entity.
entity
- entity object to represent it as JSONcallback
- callbackParameterName for JSONPorigin
- originJsonResponseBuilder}
public static javax.ws.rs.core.Response buildDownloadFile(String contentDispositionName, File file, com.codahale.metrics.Meter numFileDownloadExceptions) throws IOException
Build a Response object representing download a file.
contentDispositionName
- The name to set in the Content-Disposition headerfile
- file to downloadIOException
public static javax.ws.rs.core.Response buildResponseUnauthorizedUser(String user)
Build a Response object representing unauthorized user, with HTML response.
user
- usernamepublic static javax.ws.rs.core.Response buildResponsePageNotFound()
Build a Response object representing page not found.
public static javax.ws.rs.core.Response buildUnauthorizedUserJsonResponse(String user, String callback)
Build a Response object representing unauthorized user, with JSON response.
user
- usernamecallback
- callbackParameterName for JSONPCopyright © 2019 The Apache Software Foundation. All rights reserved.