jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guo Du <mrdu...@gmail.com>
Subject Re: Location of repository.xml and workspace.xml
Date Sat, 10 Oct 2009 09:23:34 GMT
On Sat, Oct 10, 2009 at 12:55 AM, Phukan, Anit <Anit_Phukan@intuit.com> wrote:
> Hi,
>
> Could anyone please let me know the correct directory location for the 2
> config files that I mentioned in the subject.
>
> It seems to work fine when the repository.xml file resides directly
> under the project (outside src). However, if I create a server and
> client project separately in my IDE(IntelliJ IDEA) and try to run the
> test cases, it's not able to read from the xml files. Is there a fixed
> location that these files have to reside under?
>
> Any piece of advice would be appreciated.
>
There are different place to load the repository, they will finally
invoke following constructor:
public TransientRepository(final File xml, final File dir)

Default constructor will detect the locations based on your current
java working directory with following code.
    private static final String CONF_PROPERTY
="org.apache.jackrabbit.repository.conf";
    private static final String CONF_DEFAULT = "repository.xml";
    private static final String HOME_PROPERTY =
"org.apache.jackrabbit.repository.home";
    private static final String HOME_DEFAULT = "repository";
public TransientRepository() {
        this(System.getProperty(CONF_PROPERTY, CONF_DEFAULT),
             System.getProperty(HOME_PROPERTY, HOME_DEFAULT));
    }

You may see more details from the TransientRepository class.

-Guo

Mime
View raw message