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

How to use
getEntity
method
in
org.restlet.Response

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

origin: org.restlet.osgi/org.restlet

/**
 * Indicates if the response should be chunked because its length is
 * unknown.
 * 
 * @param response
 *            The response to analyze.
 * @return True if the response should be chunked.
 */
public boolean shouldResponseBeChunked(Response response) {
  return (response.getEntity() != null)
      && !response.getEntity().hasKnownSize();
}
origin: org.restlet.osgi/org.restlet

/**
 * Returns the entity representation.
 * 
 * @return The entity representation.
 */
@Override
public Representation getEntity() {
  return getWrappedResponse().getEntity();
}
origin: gofore/aws-training

  @Override
  public void handle(Request request, Response response) {
    super.handle(request, response);
    Optional.ofNullable(response.getEntity())
        .ifPresent(r -> r.setCharacterSet(CharacterSet.UTF_8));
  }
}
origin: org.restlet.osgi/org.restlet

/**
 * If the response entity comes back with no identifier, automatically set
 * the request's resource reference's identifier. This is very useful to
 * resolve relative references in XSLT for example.
 */
@Override
protected void afterHandle(Request request, Response response) {
  if ((response.getEntity() != null)
      && (response.getEntity().getLocationRef() == null)) {
    response.getEntity().setLocationRef(
        request.getResourceRef().getTargetRef().toString());
  }
}
origin: org.restlet.osgi/org.restlet

/**
 * Returns the response entity representation.
 * 
 * @return The response entity representation.
 */
public Representation getResponseEntity() {
  return getResponse() == null ? null : getResponse().getEntity();
}
origin: DeviceConnect/DeviceConnect-Android

/**
 * Returns the response entity representation.
 * 
 * @return The response entity representation.
 */
public static Representation getResourceResponseEntity() {
  return getResourceResponse() == null ? null : getResourceResponse().getEntity();
}
origin: org.restlet.jee/org.restlet.ext.xml

@Override
protected void afterHandle(Request request, Response response) {
  if ((getMode() == MODE_RESPONSE) && canTransform(response.getEntity())) {
    response.setEntity(transform(response.getEntity()));
  }
}
origin: org.restlet.android/org.restlet.ext.atom

/**
 * Constructor.
 * 
 * @param clientDispatcher
 *            The client HTTP dispatcher.
 * @param entryUri
 *            The entry URI.
 * @throws IOException
 */
public Entry(Client clientDispatcher, String entryUri) throws IOException {
  this(clientDispatcher.handle(new Request(Method.GET, entryUri))
      .getEntity());
}
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.android/org.restlet.ext.atom

/**
 * Constructor.
 * 
 * @param clientDispatcher
 *            The client HTTP dispatcher.
 * @param feedUri
 *            The feed URI.
 * @throws IOException
 */
public Feed(Client clientDispatcher, String feedUri) throws IOException {
  this(clientDispatcher.handle(new Request(Method.GET, feedUri))
      .getEntity());
}
origin: org.restlet.jee/org.restlet.ext.atom

/**
 * Constructor.
 * 
 * @param clientDispatcher
 *            The client HTTP dispatcher.
 * @param entryUri
 *            The entry URI.
 * @throws IOException
 */
public Entry(Client clientDispatcher, String entryUri) throws IOException {
  this(clientDispatcher.handle(new Request(Method.GET, entryUri))
      .getEntity());
}
origin: org.restlet.jee/org.restlet.ext.atom

/**
 * Constructor.
 * 
 * @param clientDispatcher
 *            The client HTTP dispatcher.
 * @param feedUri
 *            The feed URI.
 * @throws IOException
 */
public Feed(Client clientDispatcher, String feedUri) throws IOException {
  this(clientDispatcher.handle(new Request(Method.GET, feedUri))
      .getEntity());
}
origin: org.restlet.android/org.restlet.ext.atom

/**
 * Constructor.
 * 
 * @param clientDispatcher
 *            The client HTTP dispatcher.
 * @param categoriesUri
 *            The feed URI.
 * @throws IOException
 */
public Categories(Client clientDispatcher, String categoriesUri)
    throws IOException {
  this(clientDispatcher.handle(new Request(Method.GET, categoriesUri))
      .getEntity());
}
origin: org.restlet.android/org.restlet.ext.atom

/**
 * Retrieves a resource representation.
 * 
 * @param uri
 *            The resource URI.
 * @return The resource representation.
 */
public Representation getResource(String uri) {
  return getClientDispatcher().handle(new Request(Method.GET, uri))
      .getEntity();
}
origin: org.restlet.jee/org.restlet.ext.atom

/**
 * Retrieves a resource representation.
 * 
 * @param uri
 *            The resource URI.
 * @return The resource representation.
 */
public Representation getResource(String uri) {
  return getClientDispatcher().handle(new Request(Method.GET, uri))
      .getEntity();
}
origin: org.apache.polygene.libraries/org.apache.polygene.library.rest-server

void updateResponse( Response response )
{
  if( entity != null )
  {
    EntityState state = spi.entityStateOf( entity );
    Tag tag = new Tag( state.entityReference().identity() + "/" + state.version() );
    response.getEntity().setModificationDate( java.util.Date.from( state.lastModified() ) );
    response.getEntity().setTag( tag );
  }
}
origin: apache/attic-polygene-java

void updateResponse( Response response )
{
  if( entity != null )
  {
    EntityState state = spi.entityStateOf( entity );
    Tag tag = new Tag( state.entityReference().identity() + "/" + state.version() );
    response.getEntity().setModificationDate( java.util.Date.from( state.lastModified() ) );
    response.getEntity().setTag( tag );
  }
}
origin: org.qi4j.library/org.qi4j.library.rest-server

public void updateResponse( Response response )
{
  if( entity != null )
  {
    EntityState state = spi.entityStateOf( entity );
    Date lastModified = new Date( state.lastModified() );
    Tag tag = new Tag( state.identity().identity() + "/" + state.version() );
    response.getEntity().setModificationDate( lastModified );
    response.getEntity().setTag( tag );
  }
}
origin: org.restlet.osgi/org.restlet.ext.oauth

@Override
public void doError(Status errorStatus) {
  Representation representation = getResponse().getEntity();
  if (representation.getMediaType().equals(MediaType.APPLICATION_JSON)) {
    // Do not throw an exception here.
    getLogger().fine("OAuth response is found.");
    // XXX: after #doError, the representation will disposed in
    // #handleInbound.
    return;
  }
  // ResourceException will be thrown.
  super.doError(errorStatus);
}
origin: org.restlet.jee/org.restlet.ext.jaxrs

  /**
   * @see MessageBodyWriter#writeTo(Object, Type, Annotation[], MediaType,
   *      MultivaluedMap, OutputStream)
   */
  @Override
  public void writeTo(Reader reader, Class<?> type, Type genericType,
      Annotation[] annotations, MediaType mediaType,
      MultivaluedMap<String, Object> httpHeaders,
      OutputStream entityStream) throws IOException {
    CharacterSet cs = Response.getCurrent().getEntity().getCharacterSet();
    IoUtils.copy(reader, IoUtils.getWriter(entityStream, cs));
  }
}
org.restletResponsegetEntity

Popular methods of Response

  • setStatus
    Sets the status.
  • setEntity
  • getStatus
    Returns the status.
  • getAttributes
  • getEntityAsText
  • isEntityAvailable
  • 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
  • Top 25 Plugins for Webstorm
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