Package org.restlet

Examples of org.restlet.Application


         } else {
            final String uri = source.toString();
            final String indexName = contentConf.getAttributeValue("index");
            // hope the directory resource can handle it
            LOG.fine("  Content directory: "+source);
            Application app = new Application(parentContext) {
               public Restlet createRoot() {
                  Directory directory = new Directory(getContext(),uri);
                  directory.setIndexName(indexName==null ? "index.html" : indexName);
                  return directory;
               }
View Full Code Here


    @Override
    protected void setUp() throws Exception {
        super.setUp();
        component = new Component();
        Server server = component.getServers().add(Protocol.HTTP, 0);
        Application application = new MyApplication();
        component.getDefaultHost().attach(application);
        component.start();
        port = server.getEphemeralPort();
    }
View Full Code Here

        client.stop();
    }

    @Override
    protected Application createApplication(Component component) {
        final Application application = new Application() {
            @Override
            public Restlet createInboundRoot() {
                final Router router = new Router(getContext());
                router.attach("/test", GetTestResource.class);
                return router;
View Full Code Here

        client.stop();
    }

    @Override
    protected Application createApplication(Component component) {
        final Application application = new Application() {
            @Override
            public Restlet createInboundRoot() {
                final Router router = new Router(getContext());
                router.attach("/test", GetTestResource.class);
                return router;
View Full Code Here

        sendPut(uri, 100000);
    }

    @Override
    protected Application createApplication(Component component) {
        final Application application = new Application() {
            @Override
            public Restlet createInboundRoot() {
                final Router router = new Router(getContext());
                router.attach("/test", PutTestResource.class);
                return router;
View Full Code Here

        int port = TEST_PORT;
        this.component = new Component();
        this.component.getServers().add(Protocol.HTTP, port);
        this.uri = "http://localhost:" + port + "/";

        final Application application = new Application() {
            @Override
            public Restlet createInboundRoot() {
                HttpBasicTestCase.this.verifier = new TestVerifier();
                HttpBasicTestCase.this.authenticator = new ChallengeAuthenticator(
                        getContext(), ChallengeScheme.HTTP_BASIC,
View Full Code Here

        this.component = new Component();

        final Server server = this.component.getServers()
                .add(Protocol.HTTPS, 0);
        configureSslServerParameters(server.getContext());
        final Application application = createApplication(this.component);

        this.component.getDefaultHost().attach(application);
        this.component.start();

        return "https://localhost:" + server.getEphemeralPort() + "/test";
View Full Code Here

        c.stop();
    }

    @Override
    protected Application createApplication(Component component) {
        final Application application = new Application() {
            @Override
            public Restlet createInboundRoot() {
                final Router router = new Router(getContext());
                router.attach("/test", GetChunkedTestResource.class);
                return router;
View Full Code Here

      router.attach("/backup",BackupResource.class);
      router.attach("/backup.zip",BackupResource.class);
      router.attach("/restore",RestoreResource.class);
      router.attach("/derby",new DerbyApplication(getContext(),db,storage));
      router.attach("/restart",RestartResource.class).getTemplate().setMatchingMode(Template.MODE_EQUALS);
      Application storageAdmin = storage.getAdministration();
      if (storageAdmin!=null) {
         router.attach("/storage",storageAdmin);
      }
      return attFilter;
   }
View Full Code Here

   {
      setNegotiated(false);
      this.classLoader = classLoader;
      this.path = path;
      int extPos = path.lastIndexOf('.');
      Application app = this.getApplication();
      type = app.getMetadataService().getDefaultMediaType();
      if (extPos>=0) {
         String ext = path.substring(extPos+1);
         Metadata mdata = this.getApplication().getMetadataService().getMetadata(ext);
         if (mdata!=null) {
            type = MediaType.valueOf(mdata.getName());
View Full Code Here

TOP

Related Classes of org.restlet.Application

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.