Examples of PathResource


Examples of org.eclipse.jetty.util.resource.PathResource

        if (url.getProtocol().equals("file"))
        {
            // some osgi frameworks do use the file protocol directly in some
            // situations. Do use the FileResource to transform the URL into a
            // File: URL#toURI is broken
            return new PathResource(url).getFile().getParentFile().getParentFile();
        }
        else if (url.getProtocol().equals("bundleentry"))
        {
            // say hello to equinox who has its own protocol.
            // we use introspection like there is no tomorrow to get access to
View Full Code Here

Examples of org.eclipse.jetty.util.resource.PathResource

    {
        // Only support PathResource alias checking
        if (!(resource instanceof PathResource))
            return false;
       
        PathResource pathResource = (PathResource)resource;

        try
        {
            Path path = pathResource.getPath();
           
            // is the file itself a symlink?
            if (Files.isSymbolicLink(path) && Files.isSameFile(path,pathResource.getAliasPath()))
            {
                if (LOG.isDebugEnabled())
                    LOG.debug("Allow symlink {} --> {}",resource,pathResource.getAliasPath());
                return true;
            }
           
            // No, so let's check each element ourselves
            Path d = path.getRoot();
            for (Path e:path)
            {
                d=d.resolve(e);
               
                while (Files.exists(d) && Files.isSymbolicLink(d))
                {
                    Path link=Files.readSymbolicLink(d);                   
                    if (!link.isAbsolute())
                        link=d.resolve(link);
                    d=link;
                }
            }
            if (pathResource.getAliasPath().equals(d))
            {
                if (LOG.isDebugEnabled())
                    LOG.debug("Allow path symlink {} --> {}",resource,d);
                return true;
            }
View Full Code Here

Examples of org.springframework.core.io.PathResource

    CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver( servletContext );
    multipartResolver.setMaxUploadSize( multipartConfig.getMaxFileSize() );
    multipartResolver.setMaxInMemorySize( multipartConfig.getFileSizeThreshold() );

    try {
      multipartResolver.setUploadTempDir( new PathResource( multipartConfig.getLocation() ) );
    }
    catch ( IOException ioe ) {
      throw new ServletException( "Illegal location for multipart uploads: " + multipartConfig.getLocation() );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.