Package org.restlet.resource

Examples of org.restlet.resource.StringRepresentation


                }
            })) {
                out.append(script.substring(0, script.length() - 3))
                   .append(", ");
            }
            response.setEntity(new StringRepresentation(out.toString()));
        } else {
            File script;
            try {
                script = resourceLoader.find(scriptPath, scriptName + ".js");
            } catch (IOException ioe) {
View Full Code Here


        super(mediaType);
    }
   
    @Override
    public Representation toRepresentation(Object object) {
        return new StringRepresentation( object.toString(), mediaType );
    }
View Full Code Here

     * @param stat The Status to report to the client
     * @param e The actual Exception that occurred
     */
    public RestletException(String s, Status stat, Throwable t){
      super(t);
        init(new StringRepresentation(s + ":" + t.getMessage(), MediaType.TEXT_PLAIN), stat);
    }
View Full Code Here

    /**
     * @param s The message to report this error to the user (will report mimetype as text/plain)
     * @param stat The Status to report to the client
     */   
    public RestletException(String s, Status stat){
        init(new StringRepresentation(s, MediaType.TEXT_PLAIN), stat);
    }
View Full Code Here

        // 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");

        //
        // store result
        item.getProperties().put(RestletConsumer.RESTLET_RESOURCE_OUT_REPRESENTATION,result);
    }
View Full Code Here

        // 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");

        //
        // store result
        item.getProperties().put(RestletConsumer.RESTLET_RESOURCE_OUT_REPRESENTATION,result);
    }
View Full Code Here

            // 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");

            //
            // store result
            item.getProperties().put(RESTLET_RESOURCE_OUT_REPRESENTATION,result);
        }
View Full Code Here

        //} else {
        //    result = new StringRepresentation(this.user.toString());
        //}
        Representation result = null;
        if (variant.getMediaType().equals(MediaType.TEXT_PLAIN))
            result = new StringRepresentation(hello);
        else
            result = new StringRepresentation("Variant no soportada");

        //
        // store result
        item.getProperties().put(RestletConsumer.RESTLET_RESOURCE_OUT_REPRESENTATION,result);
    }
View Full Code Here

            response.setStatus(Status.CLIENT_ERROR_METHOD_NOT_ALLOWED);
        }
    }
   
    private void doGet(Request request, Response response) {
        Representation result = new StringRepresentation(
                "<html><body>\n"
                +"<a id=\"logo\" href=\"http://geowebcache.org\">"
                +"<img src=\"http://geowebcache.org/trac/chrome/site/geowebcache_logo.png\" alt=\"\" height=\"100\" width=\"353\" border=\"0\"/></a>\n"
                +"<h3>Resources available from here:</h3>"
                +"<ul>"
View Full Code Here

     */
    public Representation getXMLRepresentation(TileLayer layer) {
        XStream xs = xmlConfig.getConfiguredXStream(new XStream());
        String xmlText = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + xs.toXML(layer);
       
        return new StringRepresentation(xmlText, MediaType.TEXT_XML);
    }
View Full Code Here

TOP

Related Classes of org.restlet.resource.StringRepresentation

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.