wlu: updated
diff --git a/org.eclipse.epf.toolbox/src/org/eclipse/epf/toolbox/utils/CopyPIIFiles.java b/org.eclipse.epf.toolbox/src/org/eclipse/epf/toolbox/utils/CopyPIIFiles.java
index 6a62a12..6925234 100644
--- a/org.eclipse.epf.toolbox/src/org/eclipse/epf/toolbox/utils/CopyPIIFiles.java
+++ b/org.eclipse.epf.toolbox/src/org/eclipse/epf/toolbox/utils/CopyPIIFiles.java
@@ -25,6 +25,11 @@
".js",
};
+ private static final String[] excludeFiles = {
+ "build.properties",
+ "package.html",
+ };
+
private static final String[] pathNames = {
"com.ibm.rmc",
"org.eclipse.epf",
@@ -38,6 +43,7 @@
private static Set<String> typeSet;
private static Set<String> excludeFolderSet;
+ private static Set<String> excludeFileSet;
static {
@@ -50,6 +56,11 @@
for (String folder : excludeFolders) {
excludeFolderSet.add(folder);
}
+
+ excludeFileSet = new HashSet<String>();
+ for (String file : excludeFiles) {
+ excludeFileSet.add(file);
+ }
}
//Hard coded parameters
@@ -59,6 +70,9 @@
private File sourceRootFolder;
private File targetRootFolder;
+ private Set<File> nonProcessedFolderSet;
+ private Set<File> nonProcessedFileSet;
+
public CopyPIIFiles() {
sourceRootFolder = new File(sourceRootFolderStr);
targetRootFolder = new File(targetRootFolderStr);
@@ -69,12 +83,28 @@
}
public void execute() {
+ nonProcessedFolderSet = new HashSet<File>();
+ nonProcessedFileSet = new HashSet<File>();
if (targetRootFolder.exists()) {
FileUtil.deleteAllFiles(targetRootFolder.getAbsolutePath());
} else {
targetRootFolder.mkdir();
}
copy(sourceRootFolder, targetRootFolder);
+
+ if (localDebug) {
+ System.out.println("LD> folders not processed: ");
+ for (File file : nonProcessedFolderSet) {
+ System.out.println("LD> " + file.getAbsolutePath().substring(sourceRootFolderStr.length()));
+ }
+ System.out.println("");
+
+ System.out.println("LD> files not processed: ");
+ for (File file : nonProcessedFileSet) {
+ System.out.println("LD> " + file.getAbsolutePath().substring(sourceRootFolderStr.length()));
+ }
+ System.out.println("");
+ }
}
private boolean copy(File srcFolder, File tgtFolder) {
@@ -83,6 +113,7 @@
List<File> subDirs = new ArrayList<File>();
int ccCount = 0;
+ List<String> copiedFileNames = new ArrayList<String>();
for (File file : files) {
if (file.isDirectory()) {
if (toProcessFolder(file)) {
@@ -93,13 +124,18 @@
ccCount++;
File tgtFile = new File(tgtFolder, file.getName());
FileUtil.copyFile(file, tgtFile);
+ copiedFileNames.add(file.getName());
}
}
}
if (localDebug && ccCount > 0) {
- System.out.println("LD> # of file copied: " + ccCount + ", " + srcFolder.getAbsolutePath().substring(
+ System.out.println("LD> Copied: " + ccCount + ", " + srcFolder.getAbsolutePath().substring(
sourceRootFolderStr.length()));
+ for (String fileName : copiedFileNames) {
+ System.out.println("LD> Copied: " + fileName);
+ }
+ System.out.println("");
}
for (File subDir : subDirs) {
@@ -114,11 +150,17 @@
private boolean toCopyFile(File file) {
String fileName = file.getName();
+ if (excludeFileSet.contains(fileName)) {
+ nonProcessedFileSet.add(file);
+ return false;
+ }
+
for (String str : startWithFiles) {
if (fileName.startsWith(str)) {
return true;
}
}
+
int ix = fileName.lastIndexOf(".");
if (ix < 0) {
return false;
@@ -128,6 +170,14 @@
}
private boolean toProcessFolder(File folder) {
+ boolean ret = toProcessFolder_(folder);
+ if (!ret) {
+ nonProcessedFolderSet.add(folder);
+ }
+ return ret;
+ }
+
+ private boolean toProcessFolder_(File folder) {
if (excludeFolderSet.contains(folder.getName())) {
return false;
}