Codota Logo
Representation.exhaust
Code IndexAdd Codota to your IDE (free)

How to use
exhaust
method
in
org.restlet.representation.Representation

Best Java code snippets using org.restlet.representation.Representation.exhaust (Showing top 11 results out of 315)

  • Common ways to obtain Representation
private void myMethod () {
Representation r =
  • Codota Iconnew EmptyRepresentation()
  • Codota IconClientResource clientResource;clientResource.get()
  • Codota IconResponse response;response.getEntity()
  • Smart code suggestions by Codota
}
origin: jtalks-org/jcommune

private void closeRestletConnection(ClientResource clientResource) {
  try {
    clientResource.getResponseEntity().exhaust();
  } catch (IOException e) {
    logger.warn("Error closing connection: {}", e.getMessage() );
  }
}
origin: stackoverflow.com

 Representation responseRepresentation = response.getEntity();
if (responseRepresentation != null) {
  try {
    responseRepresentation.exhaust();
  } catch (IOException e) {
    // handle exception
  }
  responseRepresentation.release();
}
origin: org.restlet.osgi/org.restlet

@Override
public long exhaust() throws IOException {
  return getWrappedRepresentation().exhaust();
}
origin: org.restlet.jse/org.restlet.example

public void stop() {
  this.proxy.stop();
  System.out.println("stop\n");
  try {
    if (this.clientResource.getResponseEntity() != null) {
      this.clientResource.getResponseEntity().exhaust();
    }
  } catch (Exception e) {
    System.out.println("stop " + e.getMessage());
    e.printStackTrace();
  }
}
origin: org.restlet.jse/org.restlet.example

public void start() {
  this.proxy.start();
  System.out.println("start\n");
  try {
    if (this.clientResource.getResponseEntity() != null) {
      this.clientResource.getResponseEntity().exhaust();
    }
  } catch (Exception e) {
    System.out.println("start " + e.getMessage());
    e.printStackTrace();
  }
}
origin: org.restlet.jse/org.restlet.example

public void acknowledge() {
  this.proxy.acknowledge();
  System.out.println("acknowledge\n");
  try {
    if (this.clientResource.getResponseEntity() != null) {
      this.clientResource.getResponseEntity().exhaust();
    }
  } catch (Exception e) {
    System.out.println("acknowledge " + e.getMessage());
  }
}
origin: stackoverflow.com

 ClientResource cr = new ClientResource(uri);
//please substitute the line below with any other kind of request you need to forward
Representation response = cr.put(json);

if (response != null) {
 try {
    <something>
  }finally {
  response.exhaust();
  response.release();
    cr.release(); 
  }
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 {
  try {
    clientResource.get().write(System.out);
  } catch (ResourceException e) {
    System.out.println("Error  status: " + e.getStatus());
    System.out.println("Error message: " + e.getMessage());
    // Consume the response's entity which releases the connection
    clientResource.getResponseEntity().exhaust();
  }
}
origin: org.restlet.jse/org.restlet.example

itemsResource.getResponseEntity().exhaust();
origin: apache/attic-polygene-java

response.getEntity().exhaust();
origin: apache/attic-polygene-java

response.getEntity().exhaust();
org.restlet.representationRepresentationexhaust

Javadoc

Exhaust the content of the representation by reading it and silently discarding anything read. By default, it relies on #getStream()and closes the retrieved stream in the end.

Popular methods of Representation

  • getMediaType
  • getStream
    Returns a stream with the representation's content. This method is ensured to return a fresh stream
  • getText
    Converts the representation to a string value. Be careful when using this method as the conversion o
  • isAvailable
    Indicates if some fresh content is potentially available, without having to actually call one of the
  • write
    Writes the representation to a byte channel. This method is ensured to write the full content for ea
  • setMediaType
  • getCharacterSet
  • getReader
    Returns a characters reader with the representation's content. This method is ensured to return a fr
  • getSize
    Returns the total size in bytes if known, UNKNOWN_SIZE (-1) otherwise. When ranges are used, this mi
  • setCharacterSet
  • getModificationDate
  • release
    Releases the representation and all associated objects like streams, channels or files which are use
  • getModificationDate,
  • release,
  • getLanguages,
  • setModificationDate,
  • getEncodings,
  • getLocationRef,
  • setTag,
  • getDisposition,
  • getTag

Popular in Java

  • Making http requests using okhttp
  • getApplicationContext (Context)
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate(i
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
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