Package org.restlet.resource

Examples of org.restlet.resource.Directory


    return path;
  }

  protected Directory createDirectory(Context context)
  {
    Directory directory = new Directory(context, rootUri);
    directory.setIndexName(indexName);
    directory.setDeeplyAccessible(deeplyAccessible);
    directory.setModifiable(modifiable);
    directory.setNegotiatingContent(negotiatingContent);
    return directory;
  }
View Full Code Here


  }

  @Override
  protected Directory createDirectory(Context context)
  {
    Directory directory = new Directory(context, rootUri);
    directory.setListingAllowed(true);
    return directory;
  }
View Full Code Here

        // Redirect by defaul to the lst of users.
        router.attachDefault(new Redirector(getContext(), "/users",
                Redirector.MODE_CLIENT_PERMANENT));

        final Directory imgDirectory = new Directory(getContext(),
                LocalReference.createFileReference(webRootPath + "/images"));
        // Add a route for the image resources
        router.attach("/images", imgDirectory);

        final Directory cssDirectory = new Directory(getContext(),
                LocalReference
                        .createFileReference(webRootPath + "/stylesheets"));
        // Add a route for the CSS resources
        router.attach("/stylesheets", cssDirectory);
View Full Code Here

            @Override
            public Restlet createInboundRoot() {
                getConnectorService().getClientProtocols().add(Protocol.CLAP);
                getConnectorService().getServerProtocols().add(Protocol.HTTP);

                final Directory directory = new Directory(getContext(),
                        "clap://class");
                directory.setListingAllowed(true);
                directory.setDeeplyAccessible(true);

                return directory;
            }
        };
View Full Code Here

        guard.setVerifier(verifier);
        router.attach("/docs/", guard).setMatchingMode(
                Template.MODE_STARTS_WITH);

        // Create a directory able to expose a hierarchy of files
        Directory directory = new Directory(getContext(), ROOT_URI);
        guard.setNext(directory);

        // Create the account handler
        Restlet account = new Restlet() {
            @Override
View Full Code Here

        // Create an application
        Application application = new Application() {
            @Override
            public Restlet createInboundRoot() {
                return new Directory(getContext(), ROOT_URI);
            }
        };

        // Attach the application to the component and start it
        component.getDefaultHost().attach(application);
View Full Code Here

        }

        @Override
        public Restlet createInboundRoot() {
            // Create a Directory that manages a local directory
            this.directory = new Directory(getContext(), LocalReference
                    .createFileReference(getTestDirectory()));
            this.directory.setNegotiatingContent(true);
            return new org.restlet.ext.freemarker.TemplateFilter(getContext(),
                    this.directory);
        }
View Full Code Here

        }

        @Override
        public Restlet createInboundRoot() {
            // Create a Directory that manages a local directory
            this.directory = new Directory(getContext(), LocalReference
                    .createFileReference(getTestDirectory()));
            this.directory.setNegotiatingContent(true);
            return new org.restlet.ext.velocity.TemplateFilter(getContext(),
                    this.directory);
        }
View Full Code Here

        @Override
        public Restlet createInboundRoot() {
            Router router = new Router();
            router.attach("/test", new TestRangeRestlet());
            router.attach("/testGet", new TestRangeGetRestlet());
            Directory directory = new Directory(getContext(),
                    LocalReference.createFileReference(testDir));
            directory.setModifiable(true);
            router.attach("/testPut/", directory);
            return router;
        }
View Full Code Here

         * @param testDirectory
         *            The test directory.
         */
        public MyApplication(File testDirectory) {
            // Create a DirectoryHandler that manages a local Directory
            this.directory = new Directory(getContext(), LocalReference
                    .createFileReference(testDirectory));
            this.directory.setNegotiatingContent(true);
        }
View Full Code Here

TOP

Related Classes of org.restlet.resource.Directory

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.