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

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

Best Java code snippets using org.restlet.representation.Representation.write (Showing top 20 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: org.restlet/org.restlet.ext.httpclient

  public void writeRequest(OutputStream os)
      throws IOException {
    entity.write(os);
  }
});
origin: org.restlet.jee/org.restlet.ext.httpclient

  public void writeTo(OutputStream os) throws IOException {
    entity.write(os);
    os.flush();
  }
});
origin: org.restlet.osgi/org.restlet

  @Override
  public void write(java.nio.channels.WritableByteChannel writableChannel)
      throws IOException {
    getWrappedRepresentation().write(writableChannel);
  }
}
origin: phenotips/phenotips

@Override
public void write(OutputStream outputStream) throws IOException
{
  if (this.representation != null) {
    this.representation.write(outputStream);
  } else if (this.object != null) {
    getObjectWriter().writeValue(outputStream, this.object);
  }
}
origin: org.restlet.gae/org.restlet.ext.jackson

  @Override
  public void write(OutputStream outputStream) throws IOException {
    if (representation != null) {
      representation.write(outputStream);
    } else if (object != null) {
      getObjectWriter().writeValue(outputStream, object);
    }
  }
}
origin: org.restlet.osgi/org.restlet

/**
 * {@inheritDoc}<br>
 * 
 * The output stream is wrapped with a new instance of the
 * {@link DigestOutputStream} class, which allows to compute progressively
 * the digest value.
 */
@Override
public void write(OutputStream outputStream) throws IOException {
  OutputStream dos = new DigestOutputStream(outputStream,
      this.computedDigest);
  getWrappedRepresentation().write(dos);
  dos.flush();
}
origin: org.restlet.jse/org.restlet.example

public static void main(String[] args) throws Exception {
  ClientResource mailClient = new ClientResource(
      "http://localhost:8111/accounts/chunkylover53/mails/123");
  mailClient.get().write(System.out);
}
origin: org.restlet.jse/org.restlet.example

public static void main(String[] args) throws Exception {
  ClientResource mailClient = new ClientResource(
      "http://localhost:8111/accounts/chunkylover53/mails/123");
  mailClient.get().write(System.out);
}
origin: org.restlet.jse/org.restlet.example

  public static void main(String[] args) throws Exception {
    ClientResource helloClientresource = new ClientResource(
        "http://localhost:8111/");
    helloClientresource.get().write(System.out);
  }
}
origin: org.restlet.jse/org.restlet.example

public static void main(String[] args) throws Exception {
  ClientResource resource = new ClientResource("http://localhost:8113/");
  resource.get().write(System.out);
}
origin: org.restlet.jse/org.restlet.example

public static void main(String[] args) throws Exception {
  // Outputting the content of a Web page
  new ClientResource("http://restlet.org").get().write(System.out);
}
origin: org.restlet.jse/org.restlet.example

public static void main(String[] args) throws Exception {
  ClientResource mailRoot = new ClientResource("http://localhost:8111/");
  mailRoot.get().write(System.out);
  String result = mailRoot.get(String.class);
  System.out.println("\n" + result);
}
origin: org.restlet.jse/org.restlet.example

public static void main(String[] args) throws Exception {
  // Create the client resource
  ClientResource resource = new ClientResource("http://restlet.org");
  // Customize the referrer property
  resource.setReferrerRef("http://www.mysite.org");
  // Write the response entity on the console
  resource.get().write(System.out);
}
origin: org.restlet.osgi/org.restlet

@Override
public void write(WritableByteChannel writableChannel) throws IOException {
  if (canEncode()) {
    OutputStream os = IoUtils.getStream(writableChannel);
    write(os);
    os.flush();
  } else {
    getWrappedRepresentation().write(writableChannel);
  }
}
origin: org.restlet.jse/org.restlet.example

public static void main(String[] args) throws Exception {
  ClientResource resource = new ClientResource("http://localhost:8111/");
  // Requesting the first five characters.
  resource.getRanges().add(new Range(0, 5));
  // Get the representation of the resource
  resource.get().write(System.out);
}
origin: org.restlet.osgi/org.restlet

@Override
public void write(java.io.Writer writer) throws IOException {
  if (canEncode()) {
    OutputStream os = IoUtils.getStream(writer, getCharacterSet());
    write(os);
    os.flush();
  } else {
    getWrappedRepresentation().write(writer);
  }
}
origin: org.restlet.jse/org.restlet.example

public static void main(String[] args) throws Exception {
  ClientResource mailClient = new ClientResource(
      "http://localhost:8111/accounts/chunkylover53/mails/123");
  Form form = new Form();
  form.add("subject", "Message to Jérôme");
  form.add("content", "Doh!\n\nAllo?");
  System.out.println(form.getWebRepresentation());
  mailClient.put(form).write(System.out);
}
origin: org.restlet.osgi/org.restlet

/**
 * Writes the representation to a byte stream.
 * 
 * @param outputStream
 *            The output stream.
 */
@Override
public void write(OutputStream outputStream) throws IOException {
  if (isDecoding()) {
    IoUtils.copy(getStream(), outputStream);
  } else {
    getWrappedRepresentation().write(outputStream);
  }
}
origin: org.restlet.jse/org.restlet.example

public static void main(String[] args) throws Exception {
  ClientResource mailClient = new ClientResource(
      "http://localhost:8111/accounts/chunkylover53/mails/123");
  Form form = new Form();
  form.add("subject", "Message to Jérôme");
  form.add("content", "Doh!\n\nAllo?");
  mailClient.put(form).write(System.out);
}
origin: org.restlet.jse/org.restlet.example

public static void main(String[] args) throws Exception {
  ClientResource mailClient = new ClientResource(
      "http://localhost:8111/accounts/chunkylover53/mails/123");
  mailClient.getRequest().getCookies()
      .add(new Cookie("Credentials", "chunkylover53=pwd"));
  Form form = new Form();
  form.add("subject", "Message to Jérôme");
  form.add("content", "Doh!\n\nAllo?");
  System.out.println(form.getWebRepresentation());
  mailClient.put(form).write(System.out);
}
org.restlet.representationRepresentationwrite

Javadoc

Writes the representation to a byte stream. This method is ensured to write the full content for each invocation unless it is a transient representation, in which case an exception is thrown.

Note that the class implementing this method shouldn't flush or close the given OutputStream after writing to it as this will be handled by the Restlet connectors automatically.

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
  • 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
  • getLanguages
  • release,
  • getLanguages,
  • setModificationDate,
  • getEncodings,
  • getLocationRef,
  • setTag,
  • exhaust,
  • getDisposition,
  • getTag

Popular in Java

  • Running tasks concurrently on multiple threads
  • scheduleAtFixedRate (Timer)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • onRequestPermissionsResult (Fragment)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
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