I'm looking at an old implementation that makes use of:


where broker is the instance of com.tridion.broker.Broker

This is deprecated, and also relies on having cd_broker_conf.xml, which we'd rather not. The storage API offers the possibility of accessing the current configuration, but that seems like re-implementing code that is probably already in Tridion. Is there a straightforward way to get the document root?


I could not find a way to get the configuration file root directly in Tridion Storage API (or Storage Extension). I have working out it with below code (sample is from Storage Extension):

    private String GetConfigFilePath()
        String _configFilePath;

        //code to pick config file from appropriate path
        CodeSource codeSource = this.class.getProtectionDomain().getCodeSource();

        File jarFile = null;

            jarFile = new File(codeSource.getLocation().toURI().getPath());
        catch (URISyntaxException e1) {
            // TODO Auto-generated catch block

        String configFileDir = jarFile.getParentFile().getPath();
        log.debug("Configuration file directory is: " + configFileDir);

        _configFilePath = configFileDir + "<configFileName>.xml";
        log.info("ConfigFilePath: " + _configFilePath);
        return _configFilePath;

I hope this may help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.