Tabnine Logo
Status.valueOf
Code IndexAdd Tabnine to your IDE (free)

How to use
valueOf
method
in
org.restlet.data.Status

Best Java code snippets using org.restlet.data.Status.valueOf (Showing top 17 results out of 315)

origin: org.restlet.osgi/org.restlet

/**
 * Constructor.
 * 
 * @param throwableClass
 *            The class or interface that hosts the annotated Java method.
 * @param annotationValue
 *            The annotation value containing the HTTP error code.
 * @param serializable
 *            Indicates if the {@link Throwable} should be serialized.
 */
public ThrowableAnnotationInfo(Class<?> throwableClass,
    int annotationValue, boolean serializable) {
  super(throwableClass, Integer.toString(annotationValue));
  // Parse the main components of the annotation value
  this.status = Status.valueOf(annotationValue);
  this.serializable = serializable;
}
origin: miltonio/milton2

@Override
public void setStatus(Status status) {
  getTarget().setStatus(org.restlet.data.Status.valueOf(status.code));
}
origin: org.metaeffekt.dcc/dcc-agent-core

response.setStatus(Status.valueOf(Integer.valueOf(responseCode)));
origin: org.restlet.jee/org.restlet.ext.apispark

response.setName(Status.valueOf(code).getReasonPhrase());
if (!StringUtils.isNullOrEmpty(apiResponse.message())) {
  response.setDescription(apiResponse.message());
origin: org.restlet.osgi/org.restlet.ext.platform

response.setName(Status.valueOf(code).getReasonPhrase());
if (!StringUtils.isNullOrEmpty(apiResponse.message())) {
  response.setDescription(apiResponse.message());
origin: org.restlet.jee/org.restlet.ext.jaxrs

/**
 * Converts the given JAX-RS {@link javax.ws.rs.core.Response} to a Restlet
 * {@link Response}.
 * 
 * @param jaxRsResponse
 *            The response returned by the resource method, perhaps as
 *            attribute of a {@link WebApplicationException}.
 * @param resourceMethod
 *            The resource method creating the response. Could be null, if
 *            an exception is handled, e.g. a
 *            {@link WebApplicationException}.
 */
private void jaxRsRespToRestletResp(
    javax.ws.rs.core.Response jaxRsResponse,
    ResourceMethod resourceMethod) {
  Response restletResponse = tlContext.get().getResponse();
  restletResponse.setStatus(Status.valueOf(jaxRsResponse.getStatus()));
  MultivaluedMap<String, Object> httpHeaders = jaxRsResponse
      .getMetadata();
  MediaType respMediaType = getMediaType(httpHeaders);
  Object jaxRsEntity = jaxRsResponse.getEntity();
  SortedMetadata<MediaType> accMediaType;
  if (respMediaType != null)
    accMediaType = SortedMetadata.get(respMediaType);
  else
    accMediaType = tlContext.get().getAccMediaTypes();
  restletResponse.setEntity(convertToRepresentation(jaxRsEntity,
      resourceMethod, respMediaType, httpHeaders, accMediaType));
  copyResponseHeaders(httpHeaders, restletResponse);
}
origin: org.restlet.jse/org.restlet.ext.platform

response.setName(Status.valueOf(code).getReasonPhrase());
if (!StringUtils.isNullOrEmpty(apiResponse.message())) {
  response.setDescription(apiResponse.message());
origin: org.restlet.gae/org.restlet.ext.platform

response.setName(Status.valueOf(code).getReasonPhrase());
if (!StringUtils.isNullOrEmpty(apiResponse.message())) {
  response.setDescription(apiResponse.message());
origin: org.restlet.jee/org.restlet.ext.platform

response.setName(Status.valueOf(code).getReasonPhrase());
if (!StringUtils.isNullOrEmpty(apiResponse.message())) {
  response.setDescription(apiResponse.message());
origin: org.restlet.osgi/org.restlet

@Override
public Warning readValue() throws IOException {
  Warning result = new Warning();
  String code = readToken();
  skipSpaces();
  String agent = readRawText();
  skipSpaces();
  String text = readQuotedString();
  // The date is not mandatory
  skipSpaces();
  String date = null;
  if (peek() != -1) {
    date = readQuotedString();
  }
  if ((code == null) || (agent == null) || (text == null)) {
    throw new IOException("Warning header malformed.");
  }
  result.setStatus(Status.valueOf(Integer.parseInt(code)));
  result.setAgent(agent);
  result.setText(text);
  if (date != null) {
    result.setDate(DateUtils.parse(date));
  }
  return result;
}
origin: org.restlet.jee/org.restlet.ext.wadl

for (final String string : statuses) {
  this.currentResponse.getStatuses().add(
      Status.valueOf(Integer.parseInt(string)));
origin: org.geowebcache/gwc-rest

} catch (HttpErrorCodeException httpException) {
  int errorCode = httpException.getErrorCode();
  Status status = Status.valueOf(errorCode);
  response.setStatus(status);
  response.setEntity(httpException.getMessage(), MediaType.TEXT_PLAIN);
origin: org.restlet.jee/org.restlet.ext.apispark

Response response = new Response();
response.setCode(statusCode);
response.setName(Status.valueOf(statusCode)
    .getReasonPhrase());
response.setMessage("Status " + statusCode);
origin: org.restlet.jee/org.restlet.ext.platform

Response response = new Response();
response.setCode(statusCode);
response.setName(Status.valueOf(statusCode)
    .getReasonPhrase());
response.setMessage("Status " + statusCode);
origin: org.restlet.jse/org.restlet.ext.platform

Response response = new Response();
response.setCode(statusCode);
response.setName(Status.valueOf(statusCode)
    .getReasonPhrase());
response.setMessage("Status " + statusCode);
origin: org.restlet.gae/org.restlet.ext.platform

Response response = new Response();
response.setCode(statusCode);
response.setName(Status.valueOf(statusCode)
    .getReasonPhrase());
response.setMessage("Status " + statusCode);
origin: org.restlet.osgi/org.restlet.ext.platform

Response response = new Response();
response.setCode(statusCode);
response.setName(Status.valueOf(statusCode)
    .getReasonPhrase());
response.setMessage("Status " + statusCode);
org.restlet.dataStatusvalueOf

Javadoc

Returns the status associated to a code. If an existing constant exists then it is returned, otherwise a new instance is created.

Popular methods of Status

  • getCode
    Returns the corresponding code (HTTP or WebDAV or custom code).
  • isSuccess
    Indicates if the status is a success status, meaning "The action was successfully received, understo
  • equals
    Indicates if the status is equal to a given one.
  • isError
    Indicates if the status is an error (client or server) status.
  • getDescription
    Returns the description. This value is typically used by the org.restlet.service.StatusService to bu
  • <init>
    Constructor.
  • isClientError
    Indicates if the status is a client error status, meaning "The request contains bad syntax or cannot
  • getThrowable
    Returns the related error or exception.
  • toString
    Returns the reason phrase of the status followed by its HTTP code.
  • getReasonPhrase
    Returns the reason phrase of this status. When supported by the HTTP server connector, this is retur
  • isConnectorError
    Indicates if the status is a connector error status, meaning "The connector failed to send or receiv
  • getName
    Returns the name of this status.
  • isConnectorError,
  • getName,
  • isRedirection,
  • isServerError,
  • isInformational,
  • getUri,
  • checkReasonPhrase,
  • isGlobalError,
  • checkDescription

Popular in Java

  • Finding current android device location
  • putExtra (Intent)
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now