Search in sources :

Example 6 with PathResolver

use of org.apache.jackrabbit.spi.commons.conversion.PathResolver in project jackrabbit by apache.

the class RetentionRegistryImplTest method testReadHoldFromFile.

public void testReadHoldFromFile() throws RepositoryException {
    PathResolver resolver = (SessionImpl) superuser;
    RetentionRegistryImpl re = new RetentionRegistryImpl((SessionImpl) superuser, createFileSystem());
    try {
        assertTrue(re.hasEffectiveHold(resolver.getQPath(childNPath), false));
        assertTrue(re.hasEffectiveHold(resolver.getQPath(childN3.getPath()), false));
        assertTrue(re.hasEffectiveHold(resolver.getQPath(childNPath + "/somechild"), false));
        assertTrue(re.hasEffectiveHold(resolver.getQPath(childNPath + "/hold/is/deep"), false));
        assertFalse(re.hasEffectiveHold(resolver.getQPath(testNodePath), false));
        assertFalse(re.hasEffectiveHold(resolver.getQPath(childN2.getPath()), false));
    } finally {
        re.close();
    }
}
Also used : PathResolver(org.apache.jackrabbit.spi.commons.conversion.PathResolver) RetentionRegistryImpl(org.apache.jackrabbit.core.retention.RetentionRegistryImpl)

Example 7 with PathResolver

use of org.apache.jackrabbit.spi.commons.conversion.PathResolver in project jackrabbit by apache.

the class ValueFormatTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    idResolver = new IdentifierResolver() {

        public Path getPath(String identifier) throws MalformedPathException {
            throw new UnsupportedOperationException();
        }

        public void checkFormat(String identifier) throws MalformedPathException {
        // nop
        }
    };
    NameResolver nResolver = new ParsingNameResolver(NameFactoryImpl.getInstance(), new DummyNamespaceResolver());
    PathResolver pResolver = new ParsingPathResolver(PathFactoryImpl.getInstance(), nResolver, idResolver);
    resolver = new DefaultNamePathResolver(nResolver, pResolver);
    qvFactory = QValueFactoryImpl.getInstance();
    vFactory = new ValueFactoryQImpl(qvFactory, resolver);
}
Also used : IdentifierResolver(org.apache.jackrabbit.spi.commons.conversion.IdentifierResolver) Path(org.apache.jackrabbit.spi.Path) ParsingNameResolver(org.apache.jackrabbit.spi.commons.conversion.ParsingNameResolver) DummyNamespaceResolver(org.apache.jackrabbit.spi.commons.conversion.DummyNamespaceResolver) MalformedPathException(org.apache.jackrabbit.spi.commons.conversion.MalformedPathException) NamePathResolver(org.apache.jackrabbit.spi.commons.conversion.NamePathResolver) PathResolver(org.apache.jackrabbit.spi.commons.conversion.PathResolver) ParsingPathResolver(org.apache.jackrabbit.spi.commons.conversion.ParsingPathResolver) DefaultNamePathResolver(org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver) DefaultNamePathResolver(org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver) NameResolver(org.apache.jackrabbit.spi.commons.conversion.NameResolver) ParsingNameResolver(org.apache.jackrabbit.spi.commons.conversion.ParsingNameResolver) ParsingPathResolver(org.apache.jackrabbit.spi.commons.conversion.ParsingPathResolver)

Aggregations

PathResolver (org.apache.jackrabbit.spi.commons.conversion.PathResolver)7 RetentionRegistryImpl (org.apache.jackrabbit.core.retention.RetentionRegistryImpl)3 DefaultNamePathResolver (org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver)3 NameResolver (org.apache.jackrabbit.spi.commons.conversion.NameResolver)3 ParsingPathResolver (org.apache.jackrabbit.spi.commons.conversion.ParsingPathResolver)3 FileSystem (org.apache.jackrabbit.core.fs.FileSystem)2 MemoryFileSystem (org.apache.jackrabbit.core.fs.mem.MemoryFileSystem)2 Path (org.apache.jackrabbit.spi.Path)2 NamePathResolver (org.apache.jackrabbit.spi.commons.conversion.NamePathResolver)2 NamespaceException (javax.jcr.NamespaceException)1 NodeId (org.apache.jackrabbit.core.id.NodeId)1 ChildNodeEntry (org.apache.jackrabbit.core.state.ChildNodeEntry)1 ItemStateException (org.apache.jackrabbit.core.state.ItemStateException)1 NoSuchItemStateException (org.apache.jackrabbit.core.state.NoSuchItemStateException)1 NodeState (org.apache.jackrabbit.core.state.NodeState)1 Name (org.apache.jackrabbit.spi.Name)1 CachingPathResolver (org.apache.jackrabbit.spi.commons.conversion.CachingPathResolver)1 DummyNamespaceResolver (org.apache.jackrabbit.spi.commons.conversion.DummyNamespaceResolver)1 IdentifierResolver (org.apache.jackrabbit.spi.commons.conversion.IdentifierResolver)1 IllegalNameException (org.apache.jackrabbit.spi.commons.conversion.IllegalNameException)1