diff options
| author | Bananeweizen <bananeweizen@gmx.de> | 2014-01-05 15:09:57 +0100 |
|---|---|---|
| committer | Bananeweizen <bananeweizen@gmx.de> | 2014-01-05 15:49:12 +0100 |
| commit | 35b3e85ed547bf331b62f5381e80189880b1f619 (patch) | |
| tree | b5dbd5087b0c307f4cc139d0bbc0686ceb102499 /main/src/cgeo/geocaching/DataStore.java | |
| parent | d13aa9e173c49eab9621aba3630f64647f8b5aa8 (diff) | |
| download | cgeo-35b3e85ed547bf331b62f5381e80189880b1f619.zip cgeo-35b3e85ed547bf331b62f5381e80189880b1f619.tar.gz cgeo-35b3e85ed547bf331b62f5381e80189880b1f619.tar.bz2 | |
#609: run directory maintenance manually
Diffstat (limited to 'main/src/cgeo/geocaching/DataStore.java')
| -rw-r--r-- | main/src/cgeo/geocaching/DataStore.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/DataStore.java b/main/src/cgeo/geocaching/DataStore.java index 99304c3..3abeff3 100644 --- a/main/src/cgeo/geocaching/DataStore.java +++ b/main/src/cgeo/geocaching/DataStore.java @@ -811,12 +811,19 @@ public class DataStore { /** * Remove obsolete cache directories in c:geo private storage. - * + */ + public static void removeObsoleteCacheDirectories() { + removeObsoleteCacheDirectories(database); + } + + /** + * Remove obsolete cache directories in c:geo private storage. + * * @param db * the read-write database to use */ private static void removeObsoleteCacheDirectories(final SQLiteDatabase db) { - final Pattern oldFilePattern = Pattern.compile("^[GC|TB|O][A-Z0-9]{4,7}$"); + final Pattern oldFilePattern = Pattern.compile("^[GC|TB|EC|GK|O][A-Z0-9]{4,7}$"); final SQLiteStatement select = db.compileStatement("select count(*) from " + dbTableCaches + " where geocode = ?"); final File[] files = LocalStorage.getStorage().listFiles(); final ArrayList<File> toRemove = new ArrayList<File>(files.length); |
