Package org.restlet.data

Examples of org.restlet.data.Encoding


     *         supported by the client.
     */
    public Representation encode(ClientInfo client,
            Representation representation) {
        Representation result = representation;
        final Encoding bestEncoding = getBestEncoding(client);

        if (bestEncoding != null) {
            result = new EncodeRepresentation(bestEncoding, representation);
        }

View Full Code Here


     * @param client
     *            The client preferences to use.
     * @return The best supported encoding for the given call.
     */
    public Encoding getBestEncoding(ClientInfo client) {
        Encoding bestEncoding = null;
        Encoding currentEncoding = null;
        Preference<Encoding> currentPref = null;
        float bestScore = 0F;

        for (final Iterator<Encoding> iter = EncodeRepresentation
                .getSupportedEncodings().iterator(); iter.hasNext();) {
View Full Code Here

      case TYPE_CHARACTER_SET:
        result.setMetadata((T) new CharacterSet(metadata.toString()));
        break;

      case TYPE_ENCODING:
        result.setMetadata((T) new Encoding(metadata.toString()));
        break;

      case TYPE_LANGUAGE:
        result.setMetadata((T) new Language(metadata.toString()));
        break;
View Full Code Here

   *         supported by the client.
   */
  public Representation encode(ClientInfo client,
      Representation representation) {
    Representation result = representation;
    Encoding bestEncoding = getBestEncoding(client);

    if (bestEncoding != null) {
      result = new EncodeRepresentation(bestEncoding, representation);
    }

View Full Code Here

   * @param client
   *            The client preferences to use.
   * @return The best supported encoding for the given call.
   */
  public Encoding getBestEncoding(ClientInfo client) {
    Encoding bestEncoding = null;
    Encoding currentEncoding = null;
    Preference<Encoding> currentPref = null;
    float bestScore = 0F;

    for (Iterator<Encoding> iter = EncodeRepresentation
        .getSupportedEncodings().iterator(); iter.hasNext();) {
View Full Code Here

TOP

Related Classes of org.restlet.data.Encoding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.