@Override
    protected Object getKey() throws IOException {
        try {
            // Create the current file name if one isn't set.
            if (key == null) {
                dir = getRandomOutputPath();
                dir = pathCreator.replaceContextVars(dir);
                dir = pathCreator.toAppPath(dir).toString();

                fileName = fileNamePattern;
                fileName = pathCreator.replaceContextVars(fileName);
                fileName = pathCreator.replaceSystemProperties(fileName);

                rolledFileName = rolledFileNamePattern;
                rolledFileName = pathCreator.replaceContextVars(rolledFileName);
                rolledFileName = pathCreator.replaceSystemProperties(rolledFileName);

                key = dir + '/' + fileName;
            }

            return key;
        } catch (final RuntimeException e) {
            throw new IOException(e.getMessage(), e);
        }
    }
Joins text instances into a single text instance.
stroom-pipeline/src/main/java/stroom/pipeline/writer/RollingFileAppender.java