Package org.apache.jetspeed.util

Examples of org.apache.jetspeed.util.Path


        return ( (Path)basePath.clone() ).addSegment( relativePath ).toString();
    }
       
    public String getResource( String path )
    {       
        Path workingPath = baseClientPath.getChild( path );
       
        if( cache.getPath( workingPath.toString() ) != null )
        {
            return cache.getPath( workingPath.toString() );
        }
        else
        {
            String locatedPath = getResource( (Path)baseClientPath.clone(), new Path( path ) );
            if( ! locatedPath.startsWith( NO_SUCH_RESOURCE ) )
            {
                if( ! path.startsWith( "/" ) )
                {
                    locatedPath = locatedPath.substring( 1 );
                }
                cache.addPath( workingPath.toString(), locatedPath );
                return locatedPath;
            }
        }
      return null;
    }
View Full Code Here


            TemplateDescriptor template = locator.locateTemplate(descriptor);
            // Check for defaults above the currently specified root
            if (template == null)
            {
                Path pathObject = new Path(path);
                if (pathObject.length() > 1)
                {
                    template = getTemplate(pathObject.getSegment(1).toString(), templateType, locator, descriptor);
                }
            }
            return template;
        }
        catch (TemplateLocatorException e)
View Full Code Here

        return basePath.addSegment( relativePath ).toString();
    }
       
    public String getResource( String path )
    {       
        Path workingPath = baseClientPath.getChild( path );
       
        String hit = cache.getPath( workingPath.toString());
        ifhit != null )
        {
            return hit;
        }
        else
        {
            String locatedPath = getResource( baseClientPath, new Path( path ) );
            if( ! locatedPath.startsWith( NO_SUCH_RESOURCE ) )
            {
                if( ! path.startsWith( "/" ) )
                {
                    locatedPath = locatedPath.substring( 1 );
                }
                cache.addPath( workingPath.toString(), locatedPath );
                return locatedPath;
            }
        }
      return null;
    }
View Full Code Here

            TemplateDescriptor template = locator.locateTemplate(descriptor);
            // Check for defaults above the currently specified root
            if (template == null)
            {
                Path pathObject = new Path(path);
                if (pathObject.length() > 1)
                {
                    template = getTemplate(pathObject.getSegment(1).toString(), templateType, locator, descriptor);
                }
            }
            return template;
        }
        catch (TemplateLocatorException e)
View Full Code Here

                                  String decorationsPath,
                                  ResourceValidator validator,
                                  JetspeedCache decorationConfigurationCache )
    {
        this.registry =  registry;
        this.decorationsPath = new Path( decorationsPath );
        this.layoutDecorationsPath = getBasePath( Fragment.LAYOUT );
        this.layoutDecorationsPathStr = this.layoutDecorationsPath.toString();
        this.portletDecorationsPath = getBasePath( Fragment.PORTLET );
        this.portletDecorationsPathStr = this.portletDecorationsPath.toString();
        this.validator = validator;
View Full Code Here

        return decoration;
    }

    public PortletDecoration getPortletDecoration( String name, RequestContext requestContext )
    {
        Path basePath = getPortletDecorationBasePath( name );
        Path baseClientPath = createClientPath( name, basePath, requestContext, Fragment.PORTLET );
        Properties configuration = getConfiguration( name, Fragment.PORTLET );
        SessionPathResolverCache sessionPathResolver = new SessionPathResolverCache( requestContext.getRequest().getSession() );
        return new PortletDecorationImpl( configuration, validator, basePath, baseClientPath, sessionPathResolver );
    }
View Full Code Here

        return new PortletDecorationImpl( configuration, validator, basePath, baseClientPath, sessionPathResolver );
    }

    public LayoutDecoration getLayoutDecoration( String name, RequestContext requestContext )
    {
        Path basePath = getLayoutDecorationBasePath( name );
        Path baseClientPath = createClientPath( name, basePath, requestContext, Fragment.LAYOUT );
        Properties configuration = getConfiguration( name, Fragment.LAYOUT );
        SessionPathResolverCache sessionPathResolver = new SessionPathResolverCache( requestContext.getRequest().getSession() );
        return new LayoutDecorationImpl( configuration, validator, basePath, baseClientPath, sessionPathResolver );
    }   
View Full Code Here

    {
        Iterator itr = rawList.iterator();
        Set filteredList = new HashSet();
        while(itr.hasNext())
        {
            Path path = new Path((String) itr.next());
            if(path.getFileName() == null && validator.resourceExists(path.toString() + propsFile))
            {
                int offset = path.length() - 1;
                filteredList.add(path.getSegment(offset));
            }
        }
        return filteredList;
    }
View Full Code Here

        rv = (ResourceValidator)rvMock.proxy();
       
        config = new Properties();
        config.setProperty("name", "test");
       
        testPathHtmlEn = new Path("/decorations/test/html/en");
    }
View Full Code Here

   
    public void testResolution() throws Exception
    {
        setUp1();
       
        Path testPath = (Path) testPathHtmlEn.clone();
        String failure1 = testPath.getChild("/images/myimage.gif").toString();
        testPath.removeLastPathSegment();
        String failure2 = testPath.getChild("/images/myimage.gif").toString();
        testPath.removeLastPathSegment();
        String success = testPath.getChild("/images/myimage.gif").toString();
       
        Constraint[] constraints = new Constraint[]{eq(failure1), eq(failure2), eq(success)};
       
        rvMock.expects(atLeastOnce()).method("resourceExists").with(new OnConsecutiveInvokes(constraints))
              .will(onConsecutiveCalls(returnValue(false), returnValue(false), returnValue(true)));
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.util.Path

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.