if (participant instanceof LogConfigurationParticipant.NonEditable || !logConfigFile.exists()) {
try {
final FileReplacer fileReplacer = new FileReplacer(logConfigFile);
// we save this file many times, don't litter backups
fileReplacer.setDeleteBackupFile(true);
fileReplacer.replace(new ContentWriter()
{
@Override
public void write(final BufferedOutputStream output)
throws IOException
{
try (final InputStream in = participant.getConfiguration()) {
StreamSupport.copy(in, output, StreamSupport.BUFFER_SIZE);
}
}
});
}
catch (IOException e) {
throw new IllegalStateException(String.format("Could not create %s as %s", name,
logConfigFile.getAbsolutePath()), e);
}
}
}
}
final File logConfigFile = new File(logConfigDir, LOG_CONF);
try {
final FileReplacer fileReplacer = new FileReplacer(logConfigFile);
// we save this file many times, don't litter backups
fileReplacer.setDeleteBackupFile(true);
fileReplacer.replace(new ContentWriter()
{
@Override
public void write(final BufferedOutputStream output)
throws IOException
{