From 12291bceb54791c5cf4b86a64ff1face99bfaae3 Mon Sep 17 00:00:00 2001 From: Jan Berkel Date: Thu, 11 Dec 2014 23:56:02 +0000 Subject: [PATCH] Move database code into correct package --- src/com/fsck/k9/mail/store/local/LocalFolder.java | 6 ++---- src/com/fsck/k9/mail/store/local/LocalMessage.java | 4 ++-- src/com/fsck/k9/mail/store/local/LocalStore.java | 6 +++--- .../fsck/k9/mail/store/{ => local}/LockableDatabase.java | 6 ++++-- src/com/fsck/k9/mail/store/local/StoreSchemaDefinition.java | 1 - src/com/fsck/k9/provider/EmailProvider.java | 6 +++--- 6 files changed, 14 insertions(+), 15 deletions(-) rename src/com/fsck/k9/mail/store/{ => local}/LockableDatabase.java (98%) diff --git a/src/com/fsck/k9/mail/store/local/LocalFolder.java b/src/com/fsck/k9/mail/store/local/LocalFolder.java index b8bd961b0..56e2558e4 100644 --- a/src/com/fsck/k9/mail/store/local/LocalFolder.java +++ b/src/com/fsck/k9/mail/store/local/LocalFolder.java @@ -6,8 +6,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.Serializable; import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.HashMap; @@ -56,8 +54,8 @@ import com.fsck.k9.mail.internet.TextBody; import com.fsck.k9.mail.internet.MimeUtility.ViewableContainer; import com.fsck.k9.mail.store.StorageManager; import com.fsck.k9.mail.store.UnavailableStorageException; -import com.fsck.k9.mail.store.LockableDatabase.DbCallback; -import com.fsck.k9.mail.store.LockableDatabase.WrappedException; +import com.fsck.k9.mail.store.local.LockableDatabase.DbCallback; +import com.fsck.k9.mail.store.local.LockableDatabase.WrappedException; import com.fsck.k9.provider.AttachmentProvider; public class LocalFolder extends Folder implements Serializable { diff --git a/src/com/fsck/k9/mail/store/local/LocalMessage.java b/src/com/fsck/k9/mail/store/local/LocalMessage.java index 474a4c849..56e20ea8d 100644 --- a/src/com/fsck/k9/mail/store/local/LocalMessage.java +++ b/src/com/fsck/k9/mail/store/local/LocalMessage.java @@ -21,8 +21,8 @@ import com.fsck.k9.mail.Part; import com.fsck.k9.mail.internet.MimeMessage; import com.fsck.k9.mail.internet.MimeUtility; import com.fsck.k9.mail.store.UnavailableStorageException; -import com.fsck.k9.mail.store.LockableDatabase.DbCallback; -import com.fsck.k9.mail.store.LockableDatabase.WrappedException; +import com.fsck.k9.mail.store.local.LockableDatabase.DbCallback; +import com.fsck.k9.mail.store.local.LockableDatabase.WrappedException; public class LocalMessage extends MimeMessage { diff --git a/src/com/fsck/k9/mail/store/local/LocalStore.java b/src/com/fsck/k9/mail/store/local/LocalStore.java index a45572309..02002c125 100644 --- a/src/com/fsck/k9/mail/store/local/LocalStore.java +++ b/src/com/fsck/k9/mail/store/local/LocalStore.java @@ -32,9 +32,8 @@ import com.fsck.k9.mail.Flag; import com.fsck.k9.mail.Folder; import com.fsck.k9.mail.MessagingException; import com.fsck.k9.mail.Store; -import com.fsck.k9.mail.store.LockableDatabase; -import com.fsck.k9.mail.store.LockableDatabase.DbCallback; -import com.fsck.k9.mail.store.LockableDatabase.WrappedException; +import com.fsck.k9.mail.store.local.LockableDatabase.DbCallback; +import com.fsck.k9.mail.store.local.LockableDatabase.WrappedException; import com.fsck.k9.mail.store.StorageManager; import com.fsck.k9.mail.store.StorageManager.StorageProvider; import com.fsck.k9.mail.store.UnavailableStorageException; @@ -724,6 +723,7 @@ public class LocalStore extends Store implements Serializable { return Utility.combine(extraFlags, ',').toUpperCase(Locale.US); } + // TODO: database should not be exposed! public LockableDatabase getDatabase() { return database; } diff --git a/src/com/fsck/k9/mail/store/LockableDatabase.java b/src/com/fsck/k9/mail/store/local/LockableDatabase.java similarity index 98% rename from src/com/fsck/k9/mail/store/LockableDatabase.java rename to src/com/fsck/k9/mail/store/local/LockableDatabase.java index b9aaa8b84..57cae16ef 100644 --- a/src/com/fsck/k9/mail/store/LockableDatabase.java +++ b/src/com/fsck/k9/mail/store/local/LockableDatabase.java @@ -1,4 +1,4 @@ -package com.fsck.k9.mail.store; +package com.fsck.k9.mail.store.local; import java.io.File; import java.util.concurrent.locks.Lock; @@ -16,6 +16,8 @@ import android.util.Log; import com.fsck.k9.K9; import com.fsck.k9.helper.FileHelper; import com.fsck.k9.mail.MessagingException; +import com.fsck.k9.mail.store.StorageManager; +import com.fsck.k9.mail.store.UnavailableStorageException; public class LockableDatabase { @@ -33,7 +35,7 @@ public class LockableDatabase { * null. * @return Any relevant data. Can be null. * @throws WrappedException - * @throws UnavailableStorageException + * @throws com.fsck.k9.mail.store.UnavailableStorageException */ T doDbWork(SQLiteDatabase db) throws WrappedException, UnavailableStorageException; } diff --git a/src/com/fsck/k9/mail/store/local/StoreSchemaDefinition.java b/src/com/fsck/k9/mail/store/local/StoreSchemaDefinition.java index 494a62af5..aec7390fc 100644 --- a/src/com/fsck/k9/mail/store/local/StoreSchemaDefinition.java +++ b/src/com/fsck/k9/mail/store/local/StoreSchemaDefinition.java @@ -18,7 +18,6 @@ import com.fsck.k9.helper.Utility; import com.fsck.k9.mail.Flag; import com.fsck.k9.mail.Folder; import com.fsck.k9.mail.Message; -import com.fsck.k9.mail.store.LockableDatabase; import com.fsck.k9.provider.AttachmentProvider; class StoreSchemaDefinition implements LockableDatabase.SchemaDefinition { diff --git a/src/com/fsck/k9/provider/EmailProvider.java b/src/com/fsck/k9/provider/EmailProvider.java index 9d88749f7..0164ce4ec 100644 --- a/src/com/fsck/k9/provider/EmailProvider.java +++ b/src/com/fsck/k9/provider/EmailProvider.java @@ -10,9 +10,9 @@ import com.fsck.k9.Preferences; import com.fsck.k9.cache.EmailProviderCacheCursor; import com.fsck.k9.helper.Utility; import com.fsck.k9.mail.MessagingException; -import com.fsck.k9.mail.store.LockableDatabase; -import com.fsck.k9.mail.store.LockableDatabase.DbCallback; -import com.fsck.k9.mail.store.LockableDatabase.WrappedException; +import com.fsck.k9.mail.store.local.LockableDatabase; +import com.fsck.k9.mail.store.local.LockableDatabase.DbCallback; +import com.fsck.k9.mail.store.local.LockableDatabase.WrappedException; import com.fsck.k9.mail.store.UnavailableStorageException; import com.fsck.k9.mail.store.local.LocalStore; import com.fsck.k9.search.SqlQueryBuilder;