String dbHome = System.getProperty("exist.home"); File f = new File(logDir); if ((!f.isAbsolute()) && dbHome != null) { logDir = dbHome + File.separatorChar + logDir; f = new File(logDir); }
File f = Configuration.lookup(logDir);
    public Journal(BrokerPool pool, File directory) throws EXistException {        this.dir = directory;        this.pool = pool;        // we use a 1 megabyte buffer:        currentBuffer = ByteBuffer.allocateDirect(1024 * 1024);                syncThread = new FileSyncThread(latch);        syncThread.start();                Boolean syncOpt = (Boolean) pool.getConfiguration().getProperty("db-connection.recovery.sync-on-commit");        if (syncOpt != null) {        	syncOnCommit = syncOpt.booleanValue();        	if (LOG.isDebugEnabled())        		LOG.debug("SyncOnCommit = " + syncOnCommit);        }                                String logDir = (String) pool.getConfiguration().getProperty("db-connection.recovery.journal-dir");        if (logDir != null) {            String dbHome = System.getProperty("exist.home");            File f = new File(logDir);            if ((!f.isAbsolute()) && dbHome != null) {                logDir = dbHome + File.separatorChar + logDir;                f = new File(logDir);            }            if (!f.exists()) {                if (LOG.isDebugEnabled())                    LOG.debug("Output directory for journal files does not exist. Creating " + f.getAbsolutePath());                try {                    f.mkdirs();                } catch (SecurityException e) {                    throw new EXistException("Failed to create output directory: " + f.getAbsolutePath());                }            }            if (!(f.canWrite())) {                throw new EXistException("Cannot write to journal output directory: " + f.getAbsolutePath());            }            this.dir = f;                    }        if (LOG.isDebugEnabled())            LOG.debug("Using directory for the journal: " + dir.getAbsolutePath());                Integer sizeOpt = (Integer) pool.getConfiguration().getProperty("db-connection.recovery.size-limit");        if (sizeOpt != null)        	journalSizeLimit = sizeOpt.intValue() * 1024 * 1024;    }