mirror of https://github.com/apache/activemq.git
fixed an issue for copying directories
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@979977 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5e0e4248de
commit
cca20b81d7
|
@ -156,20 +156,19 @@ public final class IOHelper {
|
|||
copyFile(src,dest,null);
|
||||
}
|
||||
|
||||
public static void copyFile(File src, File dest,FilenameFilter filter) throws IOException {
|
||||
public static void copyFile(File src, File dest, FilenameFilter filter) throws IOException {
|
||||
if (src.getCanonicalPath().equals(dest.getCanonicalPath()) == false) {
|
||||
if (src.isDirectory()) {
|
||||
if (dest.isDirectory()) {
|
||||
mkdirs(dest);
|
||||
List<File> list = getFiles(src,filter);
|
||||
for (File f : list) {
|
||||
if (f.isFile()) {
|
||||
File target = new File(getCopyParent(src, dest, f), f.getName());
|
||||
copySingleFile(f, target);
|
||||
}
|
||||
}
|
||||
|
||||
mkdirs(dest);
|
||||
List<File> list = getFiles(src, filter);
|
||||
for (File f : list) {
|
||||
if (f.isFile()) {
|
||||
File target = new File(getCopyParent(src, dest, f), f.getName());
|
||||
copySingleFile(f, target);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (dest.isDirectory()) {
|
||||
mkdirs(dest);
|
||||
File target = new File(dest, src.getName());
|
||||
|
|
Loading…
Reference in New Issue