summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid W. Miller2012-04-16 12:50:21 (EDT)
committerRoberto E. Escobar2012-04-16 12:50:21 (EDT)
commit634b9d03e0251e0354ffb709b49919d577003241 (patch)
tree48b4b65c97bb0a9b69e4f14baa02b10f5b61a4a1
parent7b1eab2377391aa5699166c7610fb445fbc345a6 (diff)
downloadorg.eclipse.osee-634b9d03e0251e0354ffb709b49919d577003241.zip
org.eclipse.osee-634b9d03e0251e0354ffb709b49919d577003241.tar.gz
org.eclipse.osee-634b9d03e0251e0354ffb709b49919d577003241.tar.bz2
refactor[bgz_376915]: Overload Lib.recursivelyListFiles to no longer require a null parameter
-rw-r--r--plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/ops/RenameFilesOperation.java3
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Lib.java10
-rw-r--r--plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/RenameFiles.java3
3 files changed, 12 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/ops/RenameFilesOperation.java b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/ops/RenameFilesOperation.java
index 55b285d..cff4ee8 100644
--- a/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/ops/RenameFilesOperation.java
+++ b/plugins/org.eclipse.osee.framework.core/src/org/eclipse/osee/framework/core/ops/RenameFilesOperation.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.framework.core.ops;
import java.io.File;
import java.util.List;
import java.util.regex.Pattern;
+
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.osee.framework.core.internal.Activator;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
@@ -54,7 +55,7 @@ public class RenameFilesOperation extends AbstractOperation {
protected void doWork(IProgressMonitor monitor) throws Exception {
Rule rule = new ReplaceAll(Pattern.compile(pathPattern.toString()), replacement.toString());
File parentFolder = new File(parentFolderPath.toString()).getCanonicalFile();
- List<File> files = Lib.recursivelyListFiles(parentFolder, null);
+ List<File> files = Lib.recursivelyListFiles(parentFolder);
int size = files.size();
int renamedFileCount = 0;
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Lib.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Lib.java
index b1d3447..4487df0 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Lib.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/Lib.java
@@ -64,7 +64,9 @@ import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;
+
import javax.swing.ImageIcon;
+
import org.eclipse.osee.framework.jdk.core.text.change.ChangeSet;
import org.eclipse.osee.framework.jdk.core.util.io.IOInputThread;
import org.eclipse.osee.framework.jdk.core.util.io.IOOutputThread;
@@ -861,8 +863,12 @@ public final class Lib {
}
public static List<File> recursivelyListFiles(File rootPath, Pattern fileNameP) {
- return recursivelyListFiles(new ArrayList<File>(400), rootPath, fileNameP);
- }
+ return recursivelyListFiles(new ArrayList<File>(400), rootPath, fileNameP);
+ }
+
+ public static List<File> recursivelyListFiles(File rootPath) {
+ return recursivelyListFiles(new ArrayList<File>(400), rootPath, null);
+ }
/**
* Assumptions: block comments are not nested and comment blocks have an ending Note: may be fooled by string
diff --git a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/RenameFiles.java b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/RenameFiles.java
index ef3f64d..39107c7 100644
--- a/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/RenameFiles.java
+++ b/plugins/org.eclipse.osee.framework.jdk.core/src/org/eclipse/osee/framework/jdk/core/util/io/RenameFiles.java
@@ -14,6 +14,7 @@ import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.regex.Pattern;
+
import org.eclipse.osee.framework.jdk.core.text.Rule;
import org.eclipse.osee.framework.jdk.core.text.change.ChangeSet;
import org.eclipse.osee.framework.jdk.core.text.rules.ReplaceAll;
@@ -31,7 +32,7 @@ public class RenameFiles {
}
Rule rule = new ReplaceAll(Pattern.compile(args[1]), args[2]);
- List<File> files = Lib.recursivelyListFiles(new File(args[0]).getCanonicalFile(), null);
+ List<File> files = Lib.recursivelyListFiles(new File(args[0]).getCanonicalFile());
int size = files.size();
int renamedFileCount = 0;