Package org.restlet.data

Examples of org.restlet.data.CharacterSet


            response.setEntity(text, mediaType);
        }
        LOG.debug("Populate Restlet response from exchange body: {}", body);

        if (exchange.getProperty(Exchange.CHARSET_NAME) != null) {
            CharacterSet cs = CharacterSet.valueOf(exchange.getProperty(Exchange.CHARSET_NAME, String.class));
            response.getEntity().setCharacterSet(cs);
        }

        // set headers at the end, as the entity must be set first
        for (Map.Entry<String, Object> entry : out.getHeaders().entrySet()) {
View Full Code Here


                String charSet = this.mediaType.getParameters().getFirstValue(
                        "charset");

                if (charSet != null) {
                    this.mediaType.getParameters().removeAll("charset");
                    this.characterSet = new CharacterSet(charSet);
                }
            }
        } catch (IOException ioe) {
            throw new IllegalArgumentException(
                    "The Content Type could not be read.", ioe);
View Full Code Here

            response.setEntity(text, mediaType);
        }
        LOG.debug("Populate Restlet response from exchange body: {}", body);

        if (exchange.getProperty(Exchange.CHARSET_NAME) != null) {
            CharacterSet cs = CharacterSet.valueOf(exchange.getProperty(Exchange.CHARSET_NAME, String.class));
            response.getEntity().setCharacterSet(cs);
        }

        // set headers at the end, as the entity must be set first
        for (Map.Entry<String, Object> entry : out.getHeaders().entrySet()) {
View Full Code Here

            this.mediaType = parseContentType(headerValue);
            final String charSet = this.mediaType.getParameters()
                    .getFirstValue("charset");
            if (charSet != null) {
                this.mediaType.getParameters().removeAll("charset");
                this.characterSet = new CharacterSet(charSet);
            }
        } catch (IOException ioe) {
            throw new IllegalArgumentException(
                    "The Content Type could not be read.", ioe);
        }
View Full Code Here

            this.mediaType = parseContentType(headerValue);
            final String charSet = this.mediaType.getParameters()
                    .getFirstValue("charset");
            if (charSet != null) {
                this.mediaType.getParameters().removeAll("charset");
                this.characterSet = new CharacterSet(charSet);
            }
        } catch (IOException ioe) {
            throw new IllegalArgumentException(
                    "The Content Type could not be read.", ioe);
        }
View Full Code Here

            final float quality = extractQuality(parameters);
            result = new Preference<T>(null, quality, parameters);

            switch (this.type) {
            case TYPE_CHARACTER_SET:
                result.setMetadata((T) new CharacterSet(metadata.toString()));
                break;

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

      float quality = extractQuality(parameters);
      result = new Preference<T>(null, quality, parameters);

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

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

      this.mediaType = pref.getMetadata();

      String charSet = this.mediaType.getParameters().getFirstValue(
          "charset");
      if (charSet != null) {
        this.characterSet = new CharacterSet(charSet);
      }
    } catch (IOException ioe) {
      ioe.printStackTrace();
    }
  }
View Full Code Here

            response.setEntity(text, mediaType);
        }
        LOG.debug("Populate Restlet response from exchange body: {}", body);

        if (exchange.getProperty(Exchange.CHARSET_NAME) != null) {
            CharacterSet cs = CharacterSet.valueOf(exchange.getProperty(Exchange.CHARSET_NAME, String.class));
            response.getEntity().setCharacterSet(cs);
        }

        // set headers at the end, as the entity must be set first
        for (Map.Entry<String, Object> entry : out.getHeaders().entrySet()) {
View Full Code Here

            response.setEntity(text, mediaType);
        }
        LOG.debug("Populate Restlet response from exchange body: {}", body);

        if (exchange.getProperty(Exchange.CHARSET_NAME) != null) {
            CharacterSet cs = CharacterSet.valueOf(exchange.getProperty(Exchange.CHARSET_NAME, String.class));
            response.getEntity().setCharacterSet(cs);
        }

        // set headers at the end, as the entity must be set first
        for (Map.Entry<String, Object> entry : out.getHeaders().entrySet()) {
View Full Code Here

TOP

Related Classes of org.restlet.data.CharacterSet

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.