Codota Logo
Status.getReasonPhrase
Code IndexAdd Codota to your IDE (free)

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

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

  • Common ways to obtain Status
private void myMethod () {
Status s =
  • Codota Iconnew Status(code)
  • Codota IconClientCall clientCall;clientCall.sendRequest(request)
  • Codota IconString reasonPhrase;String description;String uri;new Status(code, reasonPhrase, description, uri)
  • Smart code suggestions by Codota
}
origin: DeviceConnect/DeviceConnect-Android

/**
 * Constructor.
 * 
 * @param status
 *            The status to associate.
 * @param cause
 *            The wrapped cause error or exception.
 */
public ResourceException(Status status, Throwable cause) {
  super((status == null) ? null : status.getReasonPhrase(), cause);
  this.status = status;
}
origin: org.restlet.osgi/org.restlet

/**
 * Returns the reason phrase of the status followed by its HTTP code.
 * 
 * @return The reason phrase of the status followed by its HTTP code.
 */
@Override
public String toString() {
  return getReasonPhrase() + " (" + this.code + ")"
      + ((getDescription() == null) ? "" : " - " + getDescription());
}
origin: DeviceConnect/DeviceConnect-Android

/**
 * Returns the reason phrase of the status followed by its HTTP code.
 * 
 * @return The reason phrase of the status followed by its HTTP code.
 */
@Override
public String toString() {
  return getReasonPhrase() + " (" + this.code + ")"
      + ((getDescription() == null) ? "" : " - " + getDescription());
}
origin: org.restlet.osgi/org.restlet

/**
 * Constructor.
 * 
 * @param status
 *            The represented status.
 * @param contactEmail
 *            The email address of the administrator to contact in case of
 *            error.
 * @param homeRef
 *            The home URI to propose in case of error.
 */
public StatusInfo(Status status, String contactEmail, String homeRef) {
  this(status.getCode(), status.getDescription(), status
      .getReasonPhrase(), status.getUri(), contactEmail, homeRef);
}
origin: org.restlet.jse/org.restlet.example

@Override
public Representation getRepresentation(Status status, Request request,
    Response response) {
  // Create the data model
  Map<String, String> dataModel = new TreeMap<String, String>();
  dataModel.put("applicationName", Application.getCurrent().getName());
  dataModel.put("statusReasonPhrase", response.getStatus()
      .getReasonPhrase());
  dataModel.put("statusDescription", response.getStatus()
      .getDescription());
  // Load the FreeMarker template
  Representation mailFtl = new ClientResource(
      LocalReference.createClapReference(getClass().getPackage())
          + "/MailStatus.ftl").get();
  // Wraps the bean with a FreeMarker representation
  return new TemplateRepresentation(mailFtl, dataModel,
      MediaType.TEXT_HTML);
}
origin: org.restlet.jse/org.restlet.example

@Override
public Representation getRepresentation(Status status, Request request,
    Response response) {
  // Create the data model
  Map<String, String> dataModel = new ConcurrentHashMap<String, String>();
  dataModel.put("applicationName", Application.getCurrent().getName());
  dataModel.put("statusDescription", response.getStatus()
      .getDescription());
  dataModel.put("statusReasonPhrase", response.getStatus()
      .getReasonPhrase());
  // Load the FreeMarker template
  Representation mailFtl = new ClientResource(
      LocalReference.createClapReference(getClass().getPackage())
          + "/MailStatus.ftl").get();
  // Wraps the bean with a FreeMarker representation
  return new TemplateRepresentation(mailFtl, dataModel,
      MediaType.TEXT_HTML);
}
origin: DeviceConnect/DeviceConnect-Android

/**
 * Constructor.
 * 
 * @param status
 *            The status to copy.
 * @param throwable
 *            The related error or exception.
 * @param description
 *            The description to associate.
 */
public Status(Status status, Throwable throwable, String description) {
  this(status.getCode(), (throwable == null) ? status.getThrowable()
      : throwable, status.getReasonPhrase(),
      (description == null) ? status.getDescription() : description,
      status.getUri());
}
origin: org.restlet.osgi/org.restlet

/**
 * Constructor.
 * 
 * @param status
 *            The status to copy.
 * @param throwable
 *            The related error or exception.
 * @param reasonPhrase
 *            The short reason phrase displayed next to the status code in a
 *            HTTP response.
 * @param description
 *            The description to associate.
 */
public Status(Status status, Throwable throwable, String reasonPhrase,
    String description) {
  this(status.getCode(), (throwable == null) ? status.getThrowable()
      : throwable, (reasonPhrase == null) ? status.getReasonPhrase()
      : reasonPhrase, (description == null) ? status.getDescription()
      : description, status.getUri());
}
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.jee/org.restlet.ext.platform

  response.setName(Status.SUCCESS_OK.getReasonPhrase());
  response.setDescription("");
  response.setMessage(Status.SUCCESS_OK.getDescription());
} else {
  response.setCode(Status.SUCCESS_NO_CONTENT.getCode());
  response.setName(Status.SUCCESS_NO_CONTENT.getReasonPhrase());
  response.setDescription("");
  response.setMessage(Status.SUCCESS_NO_CONTENT.getDescription());
origin: org.restlet.jee/org.restlet.ext.apispark

  response.setName(Status.SUCCESS_OK.getReasonPhrase());
  response.setDescription("");
  response.setMessage(Status.SUCCESS_OK.getDescription());
} else {
  response.setCode(Status.SUCCESS_NO_CONTENT.getCode());
  response.setName(Status.SUCCESS_NO_CONTENT.getReasonPhrase());
  response.setDescription("");
  response.setMessage(Status.SUCCESS_NO_CONTENT.getDescription());
origin: org.restlet.osgi/org.restlet.ext.platform

  response.setName(Status.SUCCESS_OK.getReasonPhrase());
  response.setDescription("");
  response.setMessage(Status.SUCCESS_OK.getDescription());
} else {
  response.setCode(Status.SUCCESS_NO_CONTENT.getCode());
  response.setName(Status.SUCCESS_NO_CONTENT.getReasonPhrase());
  response.setDescription("");
  response.setMessage(Status.SUCCESS_NO_CONTENT.getDescription());
origin: org.restlet.jse/org.restlet.ext.platform

  response.setName(Status.SUCCESS_OK.getReasonPhrase());
  response.setDescription("");
  response.setMessage(Status.SUCCESS_OK.getDescription());
} else {
  response.setCode(Status.SUCCESS_NO_CONTENT.getCode());
  response.setName(Status.SUCCESS_NO_CONTENT.getReasonPhrase());
  response.setDescription("");
  response.setMessage(Status.SUCCESS_NO_CONTENT.getDescription());
origin: org.restlet.gae/org.restlet.ext.platform

  response.setName(Status.SUCCESS_OK.getReasonPhrase());
  response.setDescription("");
  response.setMessage(Status.SUCCESS_OK.getDescription());
} else {
  response.setCode(Status.SUCCESS_NO_CONTENT.getCode());
  response.setName(Status.SUCCESS_NO_CONTENT.getReasonPhrase());
  response.setDescription("");
  response.setMessage(Status.SUCCESS_NO_CONTENT.getDescription());
origin: org.restlet.osgi/org.restlet

/**
 * Adds the response headers for the handled uniform call.
 * 
 * @param response
 *            The response returned.
 */
protected void addResponseHeaders(HttpResponse response) {
  try {
    // Add all the necessary headers
    HeaderUtils.addGeneralHeaders(response, response.getHttpCall()
        .getResponseHeaders());
    HeaderUtils.addResponseHeaders(response, response.getHttpCall()
        .getResponseHeaders());
    // Set the status code in the response
    if (response.getStatus() != null) {
      response.getHttpCall().setStatusCode(
          response.getStatus().getCode());
      response.getHttpCall().setReasonPhrase(
          response.getStatus().getReasonPhrase());
    }
  } catch (Exception e) {
    getLogger().log(Level.WARNING,
        "Exception intercepted while adding the response headers",
        e);
    response.getHttpCall().setStatusCode(
        Status.SERVER_ERROR_INTERNAL.getCode());
    response.getHttpCall().setReasonPhrase(
        Status.SERVER_ERROR_INTERNAL.getReasonPhrase());
  }
}
origin: org.restlet.jee/org.restlet.ext.apispark

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

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

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

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

response.setCode(statusCode);
response.setName(Status.valueOf(statusCode)
    .getReasonPhrase());
response.setMessage("Status " + statusCode);
org.restlet.dataStatusgetReasonPhrase

Javadoc

Returns the reason phrase of this status. When supported by the HTTP server connector, this is returned in the first line of the HTTP response, next to to the status code.

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
  • valueOf
    Returns the status associated to a code. If an existing constant exists then it is returned, otherwi
  • getThrowable
    Returns the related error or exception.
  • toString
    Returns the reason phrase of the status followed by its HTTP code.
  • 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

  • Making http requests using okhttp
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • orElseThrow (Optional)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now