Bug 746860 - Don't fail when creating directories that already exist. r=blassey

This commit is contained in:
Gian-Carlo Pascutto 2012-05-09 00:50:52 +02:00
Родитель a884abb611
Коммит 3ce0903231
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -229,17 +229,17 @@ public final class GeckoProfile {
continue;
}
} catch (SecurityException se) {
Log.e(LOGTAG, "Unable to rename file to " + target.getAbsolutePath() + " while moving profiles", se);
Log.w(LOGTAG, "Unable to rename file to " + target.getAbsolutePath() + " while moving profiles", se);
}
// rename failed, try moving manually
if (f.isDirectory()) {
if (target.mkdirs()) {
if (target.exists() || target.mkdirs()) {
moveDirContents(f, target);
} else {
Log.e(LOGTAG, "Unable to create folder " + target.getAbsolutePath() + " while moving profiles");
}
} else {
if (! moveFile(f, target)) {
if (!moveFile(f, target)) {
Log.e(LOGTAG, "Unable to move file " + target.getAbsolutePath() + " while moving profiles");
}
}