Package org.restlet

Examples of org.restlet.Restlet


            this.uriMap.put(uri, rep);
        }

        @Override
        public Restlet createInboundRoot() {
            return new Restlet() {
                @Override
                public void handle(Request request, Response response) {
                    String remainder = request.getResourceRef()
                            .getRemainingPart();
                    Representation answer = SimpleUriMapApplication.this.uriMap
View Full Code Here


                    "TestRealm", "mySecretServerKey");
            MapVerifier mapVerifier = new MapVerifier();
            mapVerifier.getLocalSecrets().put("scott", "tiger".toCharArray());
            da.setWrappedVerifier(mapVerifier);

            Restlet restlet = new Restlet(getContext()) {
                @Override
                public void handle(Request request, Response response) {
                    response.setEntity("hello, world", MediaType.TEXT_PLAIN);
                }
            };
View Full Code Here

        helper = new org.restlet.engine.connector.HttpServerHelper(null);
        Engine.getInstance().getRegisteredServers().add(0, helper);
        Engine.setLogLevel(Level.FINE);

        Server server = new Server(new Context(), Protocol.HTTP, 8554,
                new Restlet() {
                    @Override
                    public void handle(Request request, Response response) {
                        FileRepresentation fr = new FileRepresentation(
                                "file:///c:/TEST/restlet-jse-2.0.5-ff.zip",
                                MediaType.APPLICATION_ZIP);
View Full Code Here

public class TestPostServer {

    public static void main(String[] args) throws Exception {

        Server server = new Server(Protocol.HTTP, 8554, new Restlet() {
            int count = 0;

            @Override
            public void handle(Request request, Response response) {
                try {
View Full Code Here

        final ClientResource fr = new ClientResource(
                "file://C/TEST/restlet-jse-2.0.5-ff.zip");

        // server.setNext(HelloServerResource.class);
        server.setNext(new Restlet() {
            @Override
            public void handle(Request request, Response response) {
                fr.put(request.getEntity());

                // try {
View Full Code Here

     * @param next
     *            The next handler.
     */
    public void setNext(org.restlet.Uniform next) {
        if (next instanceof Restlet) {
            Restlet nextRestlet = (Restlet) next;

            if (nextRestlet.getContext() == null) {
                nextRestlet.setContext(getContext());
            }
        }

        this.next = next;

View Full Code Here

                "Uses direct access, so you can access the port");
    }

    public void startServer(final Application application, Protocol protocol)
            throws Exception {
        this.connector = new Restlet()
        {
            @Override
            public void handle(Request request, Response response)
            {
                try {
View Full Code Here

    final Reference reference = request.getResourceRef();
    if (reference.getBaseRef() == null) {
      reference.setBaseRef(reference.getHostIdentifier());
    }
    request.setOriginalRef(reference.getTargetRef());
    final Restlet connector = getClientConnector();
    if (shouldAccessWithoutTcp()) {
      final String hostDomain = request.getResourceRef().getHostDomain();
      getHttpHeaders(request).add("host", hostDomain);
    }
    Response response = new Response(request);
    connector.handle(request, response);
    if (!usingTcp && request.getMethod().equals(Method.HEAD)) {
      response.setEntity(new WrapperRepresentation(response.getEntity()) {

        @Override
        public ReadableByteChannel getChannel() throws IOException {
View Full Code Here

         vhost.attach("/admin",adminGuard);
        
      }
     
      admins = new HashMap<String,Restlet>();
      Restlet lastAdmin = null;
      for (final DB adminDB : dbList.values()) {
         getLogger().info("Configuring database "+adminDB.getName()+" for administration");
         ServerConfiguration.Database databaseConf = serverConf.getDatabases().get(adminDB.getName());
         AuthService service = null;
         if (databaseConf==null || databaseConf.getAuthName()==null) {
View Full Code Here

      }
     
      Storage storage = storageFactory.getStorage(atomDB.getDB());


      Restlet adminApp = admins.get(atomDB.getName());
      if (adminApp==null) {
         getLogger().warning("There is no admin restlet for "+atomDB.getName());
      }
     
      AtomApplication app = new AtomApplication(childContext,auth,atomDB.getDB(),storage,host.allowQueries());
View Full Code Here

TOP

Related Classes of org.restlet.Restlet

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.