Examples of ReadableRepresentation


Examples of com.theoryinpractise.halbuilder.api.ReadableRepresentation

    String hal = HalHmacResourceFactory.INSTANCE
      .newUserResource(locale, path, clientUser)
      .get(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    Map<String, Object> properties = rr.getProperties();

    CustomerUserDto customerUser = new CustomerUserDto();
    // Mandatory properties (will cause IllegalStateException if not present)
    // Optional direct properties
    // Optional properties
View Full Code Here

Examples of com.theoryinpractise.halbuilder.api.ReadableRepresentation

    String hal = HalHmacResourceFactory.INSTANCE
      .newUserResource(locale, path, clientUser)
      .get(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    Map<String, Object> properties = rr.getProperties();

    return buildClientCart(rr, properties);
  }
View Full Code Here

Examples of com.theoryinpractise.halbuilder.api.ReadableRepresentation

      .newUserResource(locale, path, clientUser)
      .entity(updateCartRequest, MediaType.APPLICATION_JSON_TYPE)
      .put(String.class);

    // Read the HAL
    ReadableRepresentation rr = unmarshalHal(hal);

    Map<String, Object> properties = rr.getProperties();

    return buildClientCart(rr, properties);
  }
View Full Code Here

Examples of org.restlet.representation.ReadableRepresentation

            }

            setEntityRegistration(inboundEntityChannel.getRegistration());

            if (inboundEntityChannel != null) {
                result = new ReadableRepresentation(inboundEntityChannel, null,
                        contentLength);
                result.setSize(contentLength);
                setMessageState(MessageState.BODY);
            }
        } else {
View Full Code Here

Examples of org.restlet.resource.ReadableRepresentation

            if (requestStream != null) {
                result = new InputRepresentation(requestStream,
                        contentMediaType, contentLength);
            } else {
                result = new ReadableRepresentation(requestChannel,
                        contentMediaType, contentLength);
            }

            for (Parameter header : getRequestHeaders()) {
                if (header.getName().equalsIgnoreCase(
View Full Code Here

Examples of org.restlet.resource.ReadableRepresentation

        Representation result = null;

        if (getResponseStream() != null) {
            result = new InputRepresentation(getResponseStream(), null);
        } else if (getResponseChannel() != null) {
            result = new ReadableRepresentation(getResponseChannel(), null);
        } else if (getMethod().equals(Method.HEAD.getName())) {
            result = new Representation() {
                @Override
                public ReadableByteChannel getChannel() throws IOException {
                    return null;
View Full Code Here

Examples of org.restlet.resource.ReadableRepresentation

            if (requestStream != null) {
                result = new InputRepresentation(requestStream,
                        contentMediaType, contentLength);
            } else {
                result = new ReadableRepresentation(requestChannel,
                        contentMediaType, contentLength);
            }

            for (Parameter header : getRequestHeaders()) {
                if (header.getName().equalsIgnoreCase(
View Full Code Here

Examples of org.restlet.resource.ReadableRepresentation

        Representation result = null;

        if (getResponseStream() != null) {
            result = new InputRepresentation(getResponseStream(), null);
        } else if (getResponseChannel() != null) {
            result = new ReadableRepresentation(getResponseChannel(), null);
        } else if (getMethod().equals(Method.HEAD.getName())) {
            result = new Representation() {
                @Override
                public ReadableByteChannel getChannel() throws IOException {
                    return null;
View Full Code Here

Examples of org.restlet.resource.ReadableRepresentation

        final ReadableByteChannel requestChannel = getRequestEntityChannel(contentLength);

        if (requestStream != null) {
            result = new InputRepresentation(requestStream, null, contentLength);
        } else if (requestChannel != null) {
            result = new ReadableRepresentation(requestChannel, null,
                    contentLength);
        }

        // TODO result may be null
        result.setSize(contentLength);
View Full Code Here

Examples of org.restlet.resource.ReadableRepresentation

        final ReadableByteChannel requestChannel = getRequestEntityChannel(contentLength);

        if (requestStream != null) {
            result = new InputRepresentation(requestStream, null, contentLength);
        } else if (requestChannel != null) {
            result = new ReadableRepresentation(requestChannel, null,
                    contentLength);
        }

        // TODO result may be null
        result.setSize(contentLength);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.