protected void onFile(File file, String relPath) throws IOException {
if (file.getName().endsWith(FileInfoScanner.FILE_SUFFIX)) {
return;
}
FileInstall entry = new FileInstall();
String hash = Files.hash(file, hf).toString();
String hashedPath = hash.substring(0, 2) + "/" + hash.substring(2, 4) + "/" + hash;
File destPath = new File(destDir, hashedPath);
entry.setHash(hash);
entry.setLocation(hashedPath);
entry.setTo(FilenameUtils.separatorsToUnix(FilenameUtils.normalize(relPath)));
entry.setSize(file.length());
applicator.apply(entry);
destPath.getParentFile().mkdirs();
ClientFileCollector.log.info(String.format("Adding %s from %s...", relPath, file.getAbsolutePath()));
Files.copy(file, destPath);
manifest.getTasks().add(entry);