}
}
}
protected boolean preProcessDirectory(File file, Path path) {
Path targetPath = getTargetPath(path);
if (targetPath == null) {
return false;
}
File targetDir = targetSite.getFile(targetPath);
if (targetDir.isFile()) {
if (targetSite.delete(targetUser, targetPath, false)) {
write(targetPath + " file deleted");
} else {
write(targetPath + " file NOT deleted");
}
}
targetSite.createDir(targetPath);
File[] targetFiles = targetDir.listFiles();
if (!path.equals(targetSite.getCMSPath())) {
for (int i = 0; i < targetFiles.length; i++) {
File srcFile = new File(file, targetFiles[i].getName());
if (!((srcFile.isFile() && targetFiles[i].isFile()) ||
(srcFile.isDirectory() && targetFiles[i].isDirectory()))) {
Path filePath = targetPath.add(targetFiles[i].getName());
if (targetSite.delete(targetUser, filePath, true)) {
write(filePath + " file/folder deleted");
} else {
write(filePath + " file/folder NOT deleted");