use of org.opengrok.indexer.util.Statistics in project OpenGrok by OpenGrok.
the class FileHistoryCache method createDirectoriesForFiles.
private void createDirectoriesForFiles(Set<String> files, Repository repository, String label) throws HistoryException {
// The directories for the files have to be created before
// the actual files otherwise storeFile() might be racing for
// mkdirs() if there are multiple files from single directory
// handled in parallel.
Statistics elapsed = new Statistics();
LOGGER.log(Level.FINE, "Starting directory creation for {0} ({1}): {2} directories", new Object[] { repository, label, files.size() });
for (final String file : files) {
File cache;
try {
cache = getCachedFile(new File(env.getSourceRootPath() + file));
} catch (ForbiddenSymlinkException ex) {
LOGGER.log(Level.FINER, ex.getMessage());
continue;
}
File dir = cache.getParentFile();
if (!dir.isDirectory() && !dir.mkdirs()) {
LOGGER.log(Level.WARNING, "Unable to create cache directory ''{0}''.", dir);
}
}
elapsed.report(LOGGER, String.format("Done creating directories for %s (%s)", repository, label));
}
Aggregations