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

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

Best Java code snippets using org.restlet.data.Status.isError (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: org.sonatype.nexus/nexus-test-utils

@Override
protected boolean matchesSafely( Status item )
{
  return item.isError();
}
origin: org.sonatype.nexus/nexus-test-harness-launcher

@Override
protected boolean matchesSafely(Status item) {
 return item.isError();
}
origin: org.restlet.osgi/org.restlet

/**
 * Indicates if the status is an error (client or server) status.
 * 
 * @return True if the status is an error (client or server) status.
 */
public boolean isError() {
  return isError(getCode());
}
origin: org.sonatype.nexus/nexus-test-utils

@Override
protected boolean matchesSafely( Response resp )
{
  return resp.getStatus().isError();
}
origin: org.restlet/org.restlet

/**
 * Indicates if the status is an error (client or server) status.
 * 
 * @return True if the status is an error (client or server) status.
 */
public boolean isError() {
  return isError(getCode());
}
origin: DeviceConnect/DeviceConnect-Android

/**
 * Indicates if the status is an error (client or server) status.
 * 
 * @return True if the status is an error (client or server) status.
 */
public boolean isError() {
  return isError(getCode());
}
origin: org.sonatype.nexus/nexus-test-harness-launcher

@Override
protected boolean matchesSafely(Response resp) {
 return resp.getStatus().isError();
}
origin: org.restlet.osgi/org.restlet.ext.platform

/**
 * Generates a name for the response given the status code.
 * The generated name will be "Success" in case of success, "Error [statusCode]" in case of error and "Status
 * [statusCode] otherwise.
 * 
 * @param statusCode
 *            The status code of the response.
 * @return The generated name.
 */
public static String generateResponseName(int statusCode) {
  String autoGeneratedName = "Status " + statusCode;
  if (Status.isSuccess(statusCode)) {
    autoGeneratedName = "Success";
  } else if (Status.isError(statusCode)) {
    autoGeneratedName = "Error " + statusCode;
  }
  return autoGeneratedName;
}
origin: org.restlet.jse/org.restlet.ext.platform

/**
 * Generates a name for the response given the status code.
 * The generated name will be "Success" in case of success, "Error [statusCode]" in case of error and "Status
 * [statusCode] otherwise.
 * 
 * @param statusCode
 *            The status code of the response.
 * @return The generated name.
 */
public static String generateResponseName(int statusCode) {
  String autoGeneratedName = "Status " + statusCode;
  if (Status.isSuccess(statusCode)) {
    autoGeneratedName = "Success";
  } else if (Status.isError(statusCode)) {
    autoGeneratedName = "Error " + statusCode;
  }
  return autoGeneratedName;
}
origin: org.restlet.gae/org.restlet.ext.platform

/**
 * Generates a name for the response given the status code.
 * The generated name will be "Success" in case of success, "Error [statusCode]" in case of error and "Status
 * [statusCode] otherwise.
 * 
 * @param statusCode
 *            The status code of the response.
 * @return The generated name.
 */
public static String generateResponseName(int statusCode) {
  String autoGeneratedName = "Status " + statusCode;
  if (Status.isSuccess(statusCode)) {
    autoGeneratedName = "Success";
  } else if (Status.isError(statusCode)) {
    autoGeneratedName = "Error " + statusCode;
  }
  return autoGeneratedName;
}
origin: org.restlet.jee/org.restlet.ext.apispark

/**
 * Generates a name for the response given the status code.
 * The generated name will be "Success" in case of success, "Error [statusCode]" in case of error and "Status
 * [statusCode] otherwise.
 * 
 * @param statusCode
 *            The status code of the response.
 * @return The generated name.
 */
public static String generateResponseName(int statusCode) {
  String autoGeneratedName = "Status " + statusCode;
  if (Status.isSuccess(statusCode)) {
    autoGeneratedName = "Success";
  } else if (Status.isError(statusCode)) {
    autoGeneratedName = "Error " + statusCode;
  }
  return autoGeneratedName;
}
origin: org.restlet.jee/org.restlet.ext.platform

/**
 * Generates a name for the response given the status code.
 * The generated name will be "Success" in case of success, "Error [statusCode]" in case of error and "Status
 * [statusCode] otherwise.
 * 
 * @param statusCode
 *            The status code of the response.
 * @return The generated name.
 */
public static String generateResponseName(int statusCode) {
  String autoGeneratedName = "Status " + statusCode;
  if (Status.isSuccess(statusCode)) {
    autoGeneratedName = "Success";
  } else if (Status.isError(statusCode)) {
    autoGeneratedName = "Error " + statusCode;
  }
  return autoGeneratedName;
}
origin: org.restlet.osgi/org.restlet.ext.oauth

@Override
public Representation handleInbound(Response response) {
  Representation result = null;
  // Verify that the request was synchronous
  if (response.getRequest().isSynchronous()) {
    if (response.getStatus().isError()) {
      doError(response.getStatus());
      // DO NOT DISPOSE THE RESPONSE.
    }/* else { */
    result = (response == null) ? null : response.getEntity();
    /* } */
  }
  return result;
}
origin: org.restlet.osgi/org.restlet

/**
 * Handles the inbound call. Note that only synchronous calls are processed.
 * 
 * @param response
 * @return The response's entity, if any.
 */
public Representation handleInbound(Response response) {
  if (response == null) {
    return null;
  }
  // Verify that the request was synchronous
  if (response.getRequest().isSynchronous()) {
    if (response.getStatus().isError()) {
      doError(response.getStatus());
      return null;
    }
    return response.getEntity();
  }
  return null;
}
origin: org.sonatype.nexus/nexus-test-harness-launcher

protected Metadata downloadMetadataFromRepository(Gav gav, String repoId)
  throws IOException, XmlPullParserException
{
 String url = String.format("%s%s%s/%s/%s/maven-metadata.xml",
   getBaseNexusUrl(),
   REPOSITORY_RELATIVE_URL,
   repoId,
   gav.getGroupId(),
   gav.getArtifactId());
 Response response = null;
 try {
  response = RequestFacade.sendMessage(new URL(url), Method.GET, null);
  if (response.getStatus().isError()) {
   return null;
  }
  try (InputStream stream = response.getEntity().getStream()) {
   MetadataXpp3Reader metadataReader = new MetadataXpp3Reader();
   return metadataReader.read(stream);
  }
 }
 finally {
  RequestFacade.releaseResponse(response);
 }
}
origin: org.restlet.osgi/org.restlet

if (response.getStatus().isError()
    && ((response.getEntity() == null) || isOverwriting())) {
  response.setEntity(getStatusService().toRepresentation(
origin: org.restlet/org.restlet.ext.jetty

  @Override
  public void sendResponse(Response response) throws IOException {
    // Add call headers
    Parameter header;
    for (final Iterator<Parameter> iter = getResponseHeaders().iterator(); iter
        .hasNext();) {
      header = iter.next();
      getConnection().getResponse().addHeader(header.getName(),
          header.getValue());
    }

    // Set the status code in the response. We do this after adding the
    // headers because when we have to rely on the 'sendError' method,
    // the Servlet containers are expected to commit their response.
    if (Status.isError(getStatusCode()) && (response.getEntity() == null)) {
      try {
        getConnection().getResponse().sendError(getStatusCode(),
            getReasonPhrase());
      } catch (IOException ioe) {
        getLogger().log(Level.WARNING,
            "Unable to set the response error status", ioe);
      }
    } else {
      // Send the response entity
      getConnection().getResponse().setStatus(getStatusCode());
      super.sendResponse(response);
    }

  }
}
origin: org.restlet.jee/org.restlet.ext.jetty

  @Override
  public void sendResponse(Response response) throws IOException {
    // Add call headers
    Parameter header;
    for (final Iterator<Parameter> iter = getResponseHeaders().iterator(); iter
        .hasNext();) {
      header = iter.next();
      getConnection().getResponse().addHeader(header.getName(),
          header.getValue());
    }

    // Set the status code in the response. We do this after adding the
    // headers because when we have to rely on the 'sendError' method,
    // the Servlet containers are expected to commit their response.
    if (Status.isError(getStatusCode()) && (response.getEntity() == null)) {
      try {
        getConnection().getResponse().sendError(getStatusCode(),
            getReasonPhrase());
      } catch (IOException ioe) {
        getLogger().log(Level.WARNING,
            "Unable to set the response error status", ioe);
      }
    } else {
      // Send the response entity
      getConnection().getResponse().setStatus(getStatusCode());
      super.sendResponse(response);
    }

  }
}
origin: org.restlet.jee/org.restlet.ext.jaxrs

  @SuppressWarnings("unchecked")
  public void handle(Request request, Response response) {
    if (response.getStatus().isError()) {
      rCallback.onFailure(new ResourceException(response.getStatus()));
    } else {
      if (actualType != null) {
        Object result = null;
        try {
          result = getClientResource().toObject(response.getEntity(), actualType);
          rCallback.onSuccess(result);
        } catch (Exception e) {
          rCallback.onFailure(new ResourceException(e));
        }
      } else {
        rCallback.onSuccess(null);
      }
    }
  }
};
origin: org.restlet.osgi/org.restlet

@SuppressWarnings("unchecked")
public void handle(Request request,
    Response response) {
  if (response.getStatus().isError()) {
    rCallback
        .onFailure(new ResourceException(
org.restlet.dataStatusisError

Javadoc

Indicates if the status is an error (client or server) status.

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.
  • 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.
  • 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

  • Making http post requests using okhttp
  • getSharedPreferences (Context)
  • setContentView (Activity)
  • onCreateOptionsMenu (Activity)
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
  • BoxLayout (javax.swing)
  • JOptionPane (javax.swing)
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