Package org.restlet.resource

Examples of org.restlet.resource.Representation


                }
            }

            if (url != null) {
                try {
                    Representation output = new InputRepresentation(url
                            .openStream(), metadataService
                            .getDefaultMediaType());

                    // Update the metadata based on file extensions
                    String name = path.substring(path.lastIndexOf('/') + 1);
View Full Code Here


                            ref.toString());
                    if (contextResponse.getStatus().isSuccess()
                            && (contextResponse.getEntity() != null)) {
                        filePath = ref.toString(false, false).substring(
                                rootLength);
                        Representation rep = contextResponse.getEntity();
                        rep.setIdentifier(baseRef + filePath);
                        resultSet.add(rep);
                    }
                }
            }
            results.addAll(resultSet);
View Full Code Here

        Request request = new Request();
        request.setResourceRef( "http://localhost/rest/foo.html");
        request.getResourceRef().setBaseRef( "http://localhost/rest");
       
        ReflectiveHTMLFormat fmt = new ReflectiveHTMLFormat(Foo.class,request,null,null);
        Representation rep = fmt.toRepresentation(new Foo("one",2,3.0));
        rep.write(System.out);
    }
View Full Code Here

        String hello = "Hello World!!";
        //
        // get Variant
        Variant variant = (Variant) item.getRestletVariant();

        Representation result = null;
        if (variant.getMediaType().equals(MediaType.TEXT_PLAIN))
            result = new StringRepresentation(hello);
        else
            result = new StringRepresentation("Variant no soportada");
View Full Code Here

        String hello = "Hello World "+name+"!!";
        //
        // get Variant
        Variant variant = (Variant) item.getRestletVariant();

        Representation result = null;
        if (variant.getMediaType().equals(MediaType.TEXT_PLAIN))
            result = new StringRepresentation(hello);
        else
            result = new StringRepresentation("Variant no soportada");
View Full Code Here

     * @throws ResourceException
     */
    public Representation represent(Variant variant) throws ResourceException {
        //
        // call process request
        Representation result = processRestletRequest(RestletConsumer.REQUEST_TYPE_GET, variant);
        //
        // returns
        return result;
    }
View Full Code Here

     * @throws ResourceException
     */
    public void acceptRepresentation(Representation entity) throws ResourceException {
        //
        // call process request
        Representation result = processRestletRequest(RestletConsumer.REQUEST_TYPE_POST, entity);
    }
View Full Code Here

     * @throws ResourceException
     */
    public void storeRepresentation(Representation entity) throws ResourceException {
        //
        // call process request
        Representation result = processRestletRequest(RestletConsumer.REQUEST_TYPE_PUT, entity);
    }
View Full Code Here

     * @throws ResourceException
     */
    public void removeRepresentations() throws ResourceException {
        //
        // call process request
        Representation result = processRestletRequest(RestletConsumer.REQUEST_TYPE_DELETE, null);
    }
View Full Code Here

        // fire consumer event
        RestletResourceData resourceData = new RestletResourceData(getContext(), getRequest(), getResponse(), variant);
        FlowContext flowContext = doConsumerLifeCycle(requestType,variant);
        //
        //
        Representation result = (Representation)flowContext.getItem().getProperties().get(RestletConsumer.RESTLET_RESOURCE_OUT_REPRESENTATION);
        //
        //
        return result;
    }
View Full Code Here

TOP

Related Classes of org.restlet.resource.Representation

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.