jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jukka Zitting" <jukka.zitt...@gmail.com>
Subject Re: initialising TransientRepository using InputStream / URL
Date Fri, 14 Jul 2006 08:27:27 GMT

On 7/14/06, Torgeir Veimo <torgeir@pobox.com> wrote:
> It would be convenient to be able to construct a TransientRepository
> with an InputStream or URL as argument for the repository config file
> instead of a filename, when the repository config file is included as
> part of a web application. This would allow the application to be
> configured even when the WAR file is not unpacked.

You can do this with a bit of extra code:

    String repositoryHome = ...;
    InputStream repositoryXml = ...;
    RepositoryConfig config = RepositoryConfig.create(
        new InputSource(repositoryXml), repositoryHome);
    Repository repository = new TransientRepository(config);

It would of course be possible to add a utility constructor that
automates this. Please file a Jira enhancement request (optionally
with a patch :-) if you like. There's also a related issue (JCR-248)
for JCA.


Jukka Zitting

Yukatan - http://yukatan.fi/ - info@yukatan.fi
Software craftsmanship, JCR consulting, and Java development

View raw message