Tabnine Logo
Response.isEntityAvailable
Code IndexAdd Tabnine to your IDE (free)

How to use
isEntityAvailable
method
in
org.restlet.Response

Best Java code snippets using org.restlet.Response.isEntityAvailable (Showing top 16 results out of 315)

origin: org.restlet.osgi/org.restlet

/**
 * Indicates if a content is available and can be sent. Several conditions
 * must be met: the content must exists and have some available data.
 * 
 * @return True if a content is available and can be sent.
 */
@Override
public boolean isEntityAvailable() {
  return getWrappedResponse().isEntityAvailable();
}
origin: org.restlet.jee/org.restlet.ext.wadl

/**
 * Indicates if the application and all its resources can be described using
 * WADL.
 * 
 * @param remainingPart
 *            The URI remaining part.
 * @param request
 *            The request to handle.
 * @param response
 *            The response to update.
 */
protected boolean canDescribe(String remainingPart, Request request,
    Response response) {
  return isAutoDescribing()
      && Method.OPTIONS.equals(request.getMethod())
      && (response.getStatus().isClientError() || !response
          .isEntityAvailable())
      && ("/".equals(remainingPart) || "".equals(remainingPart));
}
origin: org.restlet.gae/org.restlet.ext.freemarker

@Override
protected void afterHandle(Request request, Response response) {
  if (response.isEntityAvailable()
      && response.getEntity().getEncodings()
          .contains(Encoding.FREEMARKER)) {
    TemplateRepresentation representation = new TemplateRepresentation(
        response.getEntity(), this.configuration, response
            .getEntity().getMediaType());
    representation.setDataModel(createDataModel(request, response));
    response.setEntity(representation);
  }
}
origin: org.restlet.jse/org.restlet.example

/**
 * Prints the resource's representation.
 * 
 * @param clientResource
 *            The Restlet client resource.
 * @throws IOException
 * @throws ResourceException
 */
public static void get(ClientResource clientResource) throws IOException,
    ResourceException {
  clientResource.get();
  if (clientResource.getStatus().isSuccess()
      && clientResource.getResponse().isEntityAvailable()) {
    clientResource.getResponseEntity().write(System.out);
  }
}
origin: org.restlet.osgi/org.restlet

if (!response.isEntityAvailable()
    || Status.REDIRECTION_NOT_MODIFIED.equals(response.getStatus())
    || Status.SUCCESS_NO_CONTENT.equals(response.getStatus())
origin: org.restlet.osgi/org.restlet

    .handle(new Request(Method.GET, targetDescriptor));
if (response.getStatus().isSuccess()
    && response.isEntityAvailable()) {
  final Representation representation = response.getEntity();
origin: com.att.ajsc/ajsc-core

/**
 * Indicates if the Component hosted by this Servlet is the default one or
 * one provided by the user.
 * 
 * @return True if the Component is the default one, false otherwise.
 */
private boolean isDefaultComponent() {
  // The Component is provided via an XML configuration file.
  Client client = createWarClient(new Context(), getServletConfig());
  Response response = client.handle(new Request(Method.GET,
      "war:///WEB-INF/restlet.xml"));
  if (response.getStatus().isSuccess() && response.isEntityAvailable()) {
    return false;
  }
  // The Component is provided via a context parameter in the "web.xml"
  // file.
  String componentAttributeName = getInitParameter(COMPONENT_KEY, null);
  if (componentAttributeName != null) {
    return false;
  }
  return true;
}
origin: org.restlet.android/org.restlet.ext.xml

  && response.isEntityAvailable()) {
try {
  result = new StreamSource(response.getEntity().getStream());
origin: org.restlet.jee/org.restlet.ext.xml

  && response.isEntityAvailable()) {
try {
  result = new StreamSource(response.getEntity().getStream());
origin: org.restlet.jse/org.restlet.ext.thymeleaf

@Override
protected void afterHandle(Request request, Response response) {
  if (response.isEntityAvailable()
      && response.getEntity().getEncodings().contains(THYMELEAF)) {
    try {
      final TemplateRepresentation representation = new TemplateRepresentation(
          (TemplateRepresentation) response.getEntity(),
          getLocale(), response.getEntity().getMediaType());
      if ((this.mapDataModel == null)
          && (this.resolverDataModel == null)) {
        representation.setDataModel(request, response);
      } else {
        if (this.mapDataModel == null) {
          representation.setDataModel(this.resolverDataModel);
        } else {
          representation.setDataModel(this.mapDataModel);
        }
      }
      response.setEntity(representation);
    } catch (IOException e) {
      response.setStatus(Status.SERVER_ERROR_INTERNAL, e);
    }
  }
}
origin: org.restlet.jse/org.restlet.ext.velocity

@Override
protected void afterHandle(Request request, Response response) {
  if (response.isEntityAvailable()
      && response.getEntity().getEncodings().contains(
          Encoding.VELOCITY)) {
origin: org.restlet.jee/org.restlet.ext.wadl

if (response.isEntityAvailable()) {
  response.setStatus(Status.SUCCESS_OK);
origin: org.restlet.osgi/org.restlet

  && response.isEntityAvailable()) {
t = (Throwable) getClientResource().toObject(
    response.getEntity(), throwableClazz);
if (response.isEntityAvailable()) {
  StatusInfo si = getClientResource()
      .toObject(response.getEntity(),
origin: org.restlet.jee/org.restlet.ext.jaxrs

  && response.isEntityAvailable()) {
t = (Throwable) getClientResource().toObject(
    response.getEntity(), throwableClazz);
if (response.isEntityAvailable()) {
  StatusInfo si = getClientResource().toObject(
      response.getEntity(), StatusInfo.class);
origin: org.restlet.jee/org.restlet.ext.wadl

/**
 * Attaches an application created from a WADL description document
 * available at a given URI reference.
 * 
 * @param wadlRef
 *            The URI reference to the WADL description document.
 * @return The created WADL application.
 */
public WadlApplication attach(Reference wadlRef) {
  WadlApplication result = null;
  // Adds some common client connectors to load the WADL documents
  if (!getClients().contains(wadlRef.getSchemeProtocol())) {
    getClients().add(wadlRef.getSchemeProtocol());
  }
  // Get the WADL document
  final Response response = getContext().getClientDispatcher().handle(
      new Request(Method.GET, wadlRef));
  if (response.getStatus().isSuccess() && response.isEntityAvailable()) {
    result = attach(response.getEntity());
  }
  return result;
}
origin: org.restlet.osgi/org.restlet

response.getServerInfo().setAcceptingRanges(true);
if (request.getMethod().isSafe() && response.isEntityAvailable()) {
  Range responseRange = response.getEntity().getRange();
  boolean rangedEntity = responseRange != null && isBytesRange(responseRange);
org.restletResponseisEntityAvailable

Popular methods of Response

  • setStatus
    Sets the status.
  • setEntity
  • getEntity
  • getStatus
    Returns the status.
  • getAttributes
  • getEntityAsText
  • getHeaders
  • redirectSeeOther
    Redirects the client to a different URI that SHOULD be retrieved using a GET method on that resource
  • getCookieSettings
    Returns the modifiable series of cookie settings provided by the server. Creates a new instance if n
  • getCurrent
    Returns the response associated to the current thread. Warning: this method should only be used unde
  • getRequest
    Returns the associated request
  • getAllowedMethods
    Returns the modifiable set of methods allowed on the requested resource. This property only has to b
  • getRequest,
  • getAllowedMethods,
  • getLocationRef,
  • setLocationRef,
  • <init>,
  • getCacheDirectives,
  • getServerInfo,
  • commit,
  • getChallengeRequests

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • getExternalFilesDir (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Permission (java.security)
    Legacy security code; do not use.
  • ImageIO (javax.imageio)
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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