Search in sources :

Example 1 with DefaultHandler

use of org.apache.jackrabbit.server.io.DefaultHandler in project sling by apache.

the class DefaultHandlerService method activate.

@Activate
@Modified
@SuppressWarnings("unused")
private void activate(final Map<String, Object> properties) {
    final String collectionType = OsgiUtil.toString(properties.get(SlingWebDavServlet.TYPE_COLLECTIONS), SlingWebDavServlet.TYPE_COLLECTIONS_DEFAULT);
    final String nonCollectionType = OsgiUtil.toString(properties.get(SlingWebDavServlet.TYPE_NONCOLLECTIONS), SlingWebDavServlet.TYPE_NONCOLLECTIONS_DEFAULT);
    final String contentType = OsgiUtil.toString(properties.get(SlingWebDavServlet.TYPE_CONTENT), SlingWebDavServlet.TYPE_CONTENT_DEFAULT);
    this.delegatee = new DefaultHandler(null, collectionType, nonCollectionType, contentType);
}
Also used : DefaultHandler(org.apache.jackrabbit.server.io.DefaultHandler) Modified(org.apache.felix.scr.annotations.Modified) Activate(org.apache.felix.scr.annotations.Activate)

Example 2 with DefaultHandler

use of org.apache.jackrabbit.server.io.DefaultHandler in project jackrabbit by apache.

the class ResourceConfigTest method testIOManagerConfigWithParam.

public void testIOManagerConfigWithParam() throws Exception {
    InputStream in = new ByteArrayInputStream(CONFIG_2.getBytes("UTF-8"));
    ResourceConfig config = new ResourceConfig(null);
    config.parse(in);
    IOManager ioMgr = config.getIOManager();
    assertNotNull(ioMgr);
    assertEquals("org.apache.jackrabbit.server.io.IOManagerImpl", ioMgr.getClass().getName());
    IOHandler[] handlers = ioMgr.getIOHandlers();
    assertNotNull(handlers);
    assertEquals(1, handlers.length);
    assertEquals("org.apache.jackrabbit.server.io.DefaultHandler", handlers[0].getName());
    DefaultHandler dh = (DefaultHandler) handlers[0];
    assertEquals("nt:unstructured", dh.getCollectionNodeType());
    assertEquals("nt:unstructured", dh.getNodeType());
    assertEquals("nt:resource", dh.getContentNodeType());
}
Also used : IOHandler(org.apache.jackrabbit.server.io.IOHandler) ByteArrayInputStream(java.io.ByteArrayInputStream) IOManager(org.apache.jackrabbit.server.io.IOManager) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) DefaultHandler(org.apache.jackrabbit.server.io.DefaultHandler)

Aggregations

DefaultHandler (org.apache.jackrabbit.server.io.DefaultHandler)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 Activate (org.apache.felix.scr.annotations.Activate)1 Modified (org.apache.felix.scr.annotations.Modified)1 IOHandler (org.apache.jackrabbit.server.io.IOHandler)1 IOManager (org.apache.jackrabbit.server.io.IOManager)1