import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
+import java.util.HashSet;
import java.util.Stack;
import org.tizen.common.util.log.Logger;
}
private static void copyRecursivelyWithoutDirChecking(File fromDir, File toDir, boolean overwrite, File... filters) throws IOException {
+ HashSet<String> filterSet = new HashSet<String>();
+ for(File filter: filters) {
+ filterSet.add(filter.getCanonicalPath());
+ }
Stack<File> fromFileStack = new Stack<File>();
Stack<File> toFileStack = new Stack<File>();
if(!toFile.exists() || !toFile.isFile() || overwrite) {
boolean found = false;
if(filters != null) {
- for(File filter: filters) {
- if(filter.getCanonicalPath().equals(fromFile.getCanonicalPath())) {
- found = true;
- break;
- }
+ if(filterSet.contains(fromFile.getCanonicalPath())) {
+ found = true;
+ break;
}
}
if(!found) {