if (prefs == null || prefs.length == 0) {
return false;
}
// find older version
Version currentVersion = new Version(versionName);
Version previousVersion = new Version("0");
File lastDir = null;
for (int i = 0; i < prefs.length; i++) {
File dir = new File(prefsDir, prefs[i]);
if (dir.isDirectory() && new File(dir, baseName + ".properties").isFile()) {
// check that there are DB files
Version v;
try {
v = new Version(prefs[i]);
}
catch (NumberFormatException nfex) {
// ignore... not a version dir...
continue;
}
if (v.compareTo(currentVersion) < 0 && v.compareTo(previousVersion) > 0) {
previousVersion = v;
lastDir = dir;
}
}
}