The WebDav Servlet puts a Repository Object in the JNDI-Context. (Parameters specified in the web.xml)

You can retrieve it from the JNDI-Context and then do what you like to do on the Repository.
One idea is taking a look into the sources of the webdav-servlet.

RepositoryAccessServlet:
   /**
     * tries to retrieve the repository using RMI
     */
    private static Repository getRepositoryByJNDI(ServletContext ctx) {
        // acquire via JNDI
String repositoryName = (String) ctx.getAttribute (CTX_ATTR_REPOSITORY_NAME); InitialContext jndiContext = (InitialContext) ctx.getAttribute(CTX_ATTR_REPOSITORY_JNDI_CONTEXT);
        if (jndiContext == null) {
            return null;
        }
        try {
Repository r = (Repository) jndiContext.lookup (repositoryName);
            log.info("Acquired repository via JNDI.");
            return r;
        } catch (NamingException e) {
log.error("Error while retrieving repository using JNDI (name=" + repositoryName + "): " + e);
            return null;
        }
    }


Example Code for Repository Access can be found in the wiki:
http://wiki.apache.org/jackrabbit/ExamplesPage

hope this helps,

Eric





Am 12.07.2006 um 13:12 schrieb Umesh Singh:

Hi,

I am able to configure the JackRabbit on Tomcat. I am also able to enable the WebDab servlet using the given war in the samples.

Can someone please point me to some sample client code to access the WebDav enabled repository? Cant find any sample to access the WebDav enabled repository using client code.

Regards,
Umesh

iO global limited, Registered in England No. 05269056 Reg. Offices: G10 B83 Columba House, Martlesham Heath, Ipswich, Suffolk. IP5 3RE

This electronic message contains information from iO global limited which may be privileged or confidential. The information is intended to be for the use of the individual(s) or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately.

This email does not constitute a contract. E&OE

Reply via email to