自动修正下载文件夹名

This commit is contained in:
seven332 committed 2014-10-12 23:54:56 +08:00
1 parent b55d5a1538
commit 07335ba49c
1 file changed
+9 -4
+9 -4
View File
@@ -87,11 +87,16 @@ public final class EhUtils {
File downloadDir = new File(Config.getDownloadPath());
File gDir = new File(downloadDir,
Utils.standardizeFilename(Integer.toString(gid)));
File defaultDir = generateGalleryDir(gid, title);
if (gDir.exists())
return gDir;
else
return generateGalleryDir(gid, title);
if (gDir.exists()) {
if (gDir.renameTo(defaultDir))
return defaultDir;
else
return gDir;
} else {
return defaultDir;
}
// TODO check a dir start with the gid, but it may take a long time
// Create a map to record all ?