in src/jetbrains/buildServer/clouds/local/LocalCloudInstance.java [223:251]
private void copyAgentToDestFolder() throws IOException {
//do not re-extract agent
if (myIsAgentExtracted.getAndSet(true)) return;
final File agentHomeDir = myImage.getAgentHomeDir();
if (agentHomeDir.isDirectory()) {
FileUtil.copyDir(agentHomeDir, myBaseDir, new FileFilter() {
private final Set<String> ourDirsToNotToCopy = new HashSet<String>() {{
Collections.addAll(this, "work", "temp", "system", "contrib");
}};
public boolean accept(@NotNull final File file) {
return !file.isDirectory() || !file.getParentFile().equals(agentHomeDir) || !ourDirsToNotToCopy.contains(file.getName());
}
});
} else if (agentHomeDir.isFile() && agentHomeDir.getName().endsWith(".zip")) {
ZipUtil.extract(agentHomeDir, myBaseDir, new FilenameFilter() {
private final Set<String> ourDirsToNotToCopy = new HashSet<String>() {{
Collections.addAll(this, "work", "temp", "system", "contrib");
}};
public boolean accept(File dir, String name) {
final File file = new File(dir, name);
return !file.isDirectory() || !file.getParentFile().equals(agentHomeDir) || !ourDirsToNotToCopy.contains(file.getName());
}
});
}
}