private static void migrateBookDir() { // Books should be on this path URI userDataArea = OSType.getOSType().getUserAreaFolder(DIR_SWORD_CONF, DIR_SWORD_CONF_ALT); File swordBookPath = new File(userDataArea.getPath()); // The "old" Book location might be in one of two locations // It might be ~/.jsword or the new project dir File oldPath = new File(CWProject.instance().getDeprecatedWritableProjectDir().getPath()); if (oldPath.isDirectory()) { migrateBookDir(oldPath, swordBookPath); return; } // now trying the new project dir oldPath = new File(CWProject.instance().getWritableProjectDir().getPath()); if (oldPath.isDirectory()) { migrateBookDir(oldPath, swordBookPath); return; } // Finally, it might be ~/.sword oldPath = new File(OSType.DEFAULT.getUserAreaFolder(DIR_SWORD_CONF, DIR_SWORD_CONF_ALT).getPath()); if (oldPath.isDirectory()) { migrateBookDir(oldPath, swordBookPath); } }
URI oldPath = getDeprecatedWritableProjectDir(); writeHome = migrateUserProjectDir(oldPath, path);