Package io.undertow.server.handlers.resource

Examples of io.undertow.server.handlers.resource.ResourceHandler


        File newSymlink = new File(rootPath, "newSymlink");

        try {
            DefaultServer.setRootHandler(new CanonicalPathHandler()
                    .setNext(new PathHandler()
                            .addPrefixPath("/path", new ResourceHandler()
                                    .setResourceManager(new FileResourceManager(newSymlink, 10485760, true, rootPath.getAbsolutePath().concat("/newDir")))
                                    .setDirectoryListingEnabled(false)
                                    .addWelcomeFiles("page.html"))));
            /**
             * This request should return a 200 code as rootPath + "/newDir" is used in the safePaths
View Full Code Here


        File rootPath = new File(getClass().getResource("page.html").toURI()).getParentFile();
        File newSymlink = new File(rootPath, "newSymlink");

        try {
            DefaultServer.setRootHandler(new PathHandler()
                            .addPrefixPath("/path", new ResourceHandler()
                                    .setResourceManager(new FileResourceManager(newSymlink, 10485760, true, rootPath.getAbsolutePath().concat("/newDir")))
                                    .setDirectoryListingEnabled(false)
                                    .addWelcomeFiles("page.html")));
            /**
             * This request should return a 200 code as rootPath + "/newDir" is used in the safePaths
View Full Code Here

        File newSymlink = new File(rootPath, "newSymlink");

        try {
            DefaultServer.setRootHandler(new CanonicalPathHandler()
                    .setNext(new PathHandler()
                            .addPrefixPath("/path", new ResourceHandler()
                                    .setResourceManager(new FileResourceManager(newSymlink, 10485760, true, rootPath.getAbsolutePath().concat("/otherDir")))
                                    .setDirectoryListingEnabled(false)
                                    .addWelcomeFiles("page.html"))));
            /**
             * This request should return a 404 code as rootPath + "/otherDir" doesnt match in rootPath + "/path/innerSymlink/page.html"
View Full Code Here

        File newSymlink = new File(rootPath, "newSymlink");

        try {
            DefaultServer.setRootHandler(new CanonicalPathHandler()
                    .setNext(new PathHandler()
                            .addPrefixPath("/path", new ResourceHandler()
                                    .setResourceManager(new FileResourceManager(newSymlink, 10485760, true, rootPath.getAbsolutePath().concat("/innerSymlink")))
                                    .setDirectoryListingEnabled(false)
                                    .addWelcomeFiles("page.html"))));
            /**
             * This request should return a 404 code as rootPath + "/innerSymlink" in safePaths will not match with canonical "/innerSymlink"
View Full Code Here

        File newSymlink = new File(rootPath, "newSymlink");

        try {
            DefaultServer.setRootHandler(new CanonicalPathHandler()
                    .setNext(new PathHandler()
                            .addPrefixPath("/path", new ResourceHandler()
                                    .setResourceManager(new FileResourceManager(newSymlink, 10485760, true, ""))
                                    .setDirectoryListingEnabled(false)
                                    .addWelcomeFiles("page.html"))));
            /**
             * This request should return a 200, base is a symlink but it should not be checked in the symlinks filter
View Full Code Here

        File newSymlink = new File(rootPath, "newSymlink");

        try {
            DefaultServer.setRootHandler(new CanonicalPathHandler()
                    .setNext(new PathHandler()
                            .addPrefixPath("/path", new ResourceHandler()
                                    .setResourceManager(new FileResourceManager(newSymlink, 10485760, true, "innerDir"))
                                    .setDirectoryListingEnabled(false)
                                    .addWelcomeFiles("page.html"))));
            /**
             * This request should return a 200, innerSymlink is a symlink pointed to innerDir
View Full Code Here

     *
     * @param resourceManager The resource manager to use
     * @return A new resource handler
     */
    public static ResourceHandler resource(final ResourceManager resourceManager) {
        return new ResourceHandler(resourceManager).setDirectoryListingEnabled(false);
    }
View Full Code Here

     *
     * @param resourceManager The resource manager to use
     * @return A new resource handler
     */
    public static ResourceHandler resource(final ResourceManager resourceManager) {
        return new ResourceHandler().setResourceManager(resourceManager).setDirectoryListingEnabled(false);
    }
View Full Code Here

     *
     * @param resourceManager The resource manager to use
     * @return A new resource handler
     */
    public static ResourceHandler resource(final ResourceManager resourceManager) {
        return new ResourceHandler().setResourceManager(resourceManager).setDirectoryListingEnabled(false);
    }
View Full Code Here

     *
     * @param resourceManager The resource manager to use
     * @return A new resource handler
     */
    public static ResourceHandler resource(final ResourceManager resourceManager) {
        return new ResourceHandler(resourceManager).setDirectoryListingEnabled(false);
    }
View Full Code Here

TOP

Related Classes of io.undertow.server.handlers.resource.ResourceHandler

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.