diff --git a/app/src/main/java/protect/card_locker/BarcodeImageWriterResultCallback.java b/app/src/main/java/protect/card_locker/BarcodeImageWriterResultCallback.java deleted file mode 100644 index a2616459e..000000000 --- a/app/src/main/java/protect/card_locker/BarcodeImageWriterResultCallback.java +++ /dev/null @@ -1,5 +0,0 @@ -package protect.card_locker; - -public interface BarcodeImageWriterResultCallback { - void onBarcodeImageWriterResult(boolean success); -} diff --git a/app/src/main/java/protect/card_locker/BarcodeImageWriterResultCallback.kt b/app/src/main/java/protect/card_locker/BarcodeImageWriterResultCallback.kt new file mode 100644 index 000000000..f81b438dc --- /dev/null +++ b/app/src/main/java/protect/card_locker/BarcodeImageWriterResultCallback.kt @@ -0,0 +1,5 @@ +package protect.card_locker + +interface BarcodeImageWriterResultCallback { + fun onBarcodeImageWriterResult(success: Boolean) +} diff --git a/app/src/main/java/protect/card_locker/async/CompatCallable.java b/app/src/main/java/protect/card_locker/async/CompatCallable.java deleted file mode 100644 index 352e0aeac..000000000 --- a/app/src/main/java/protect/card_locker/async/CompatCallable.java +++ /dev/null @@ -1,9 +0,0 @@ -package protect.card_locker.async; - -import java.util.concurrent.Callable; - -public interface CompatCallable extends Callable { - void onPostExecute(Object result); - - void onPreExecute(); -} diff --git a/app/src/main/java/protect/card_locker/async/CompatCallable.kt b/app/src/main/java/protect/card_locker/async/CompatCallable.kt new file mode 100644 index 000000000..38763c1bb --- /dev/null +++ b/app/src/main/java/protect/card_locker/async/CompatCallable.kt @@ -0,0 +1,9 @@ +package protect.card_locker.async + +import java.util.concurrent.Callable + +interface CompatCallable : Callable { + fun onPostExecute(result: Any?) + + fun onPreExecute() +} diff --git a/app/src/main/java/protect/card_locker/importexport/DataFormat.java b/app/src/main/java/protect/card_locker/importexport/DataFormat.java deleted file mode 100644 index 929d7c236..000000000 --- a/app/src/main/java/protect/card_locker/importexport/DataFormat.java +++ /dev/null @@ -1,7 +0,0 @@ -package protect.card_locker.importexport; - -public enum DataFormat { - Catima, - Fidme, - VoucherVault; -} diff --git a/app/src/main/java/protect/card_locker/importexport/DataFormat.kt b/app/src/main/java/protect/card_locker/importexport/DataFormat.kt new file mode 100644 index 000000000..ae87a25ef --- /dev/null +++ b/app/src/main/java/protect/card_locker/importexport/DataFormat.kt @@ -0,0 +1,7 @@ +package protect.card_locker.importexport + +enum class DataFormat { + Catima, + Fidme, + VoucherVault +} diff --git a/app/src/main/java/protect/card_locker/importexport/Exporter.java b/app/src/main/java/protect/card_locker/importexport/Exporter.java deleted file mode 100644 index c6af80c88..000000000 --- a/app/src/main/java/protect/card_locker/importexport/Exporter.java +++ /dev/null @@ -1,20 +0,0 @@ -package protect.card_locker.importexport; - -import android.content.Context; -import android.database.sqlite.SQLiteDatabase; - -import java.io.IOException; -import java.io.OutputStream; - -/** - * Interface for a class which can export the contents of the database - * in a given format. - */ -public interface Exporter { - /** - * Export the database to the output stream in a given format. - * - * @throws IOException - */ - void exportData(Context context, SQLiteDatabase database, OutputStream output, char[] password) throws IOException, InterruptedException; -} diff --git a/app/src/main/java/protect/card_locker/importexport/Exporter.kt b/app/src/main/java/protect/card_locker/importexport/Exporter.kt new file mode 100644 index 000000000..bc407248b --- /dev/null +++ b/app/src/main/java/protect/card_locker/importexport/Exporter.kt @@ -0,0 +1,25 @@ +package protect.card_locker.importexport + +import android.content.Context +import android.database.sqlite.SQLiteDatabase +import java.io.IOException +import java.io.OutputStream + +/** + * Interface for a class which can export the contents of the database + * in a given format. + */ +interface Exporter { + /** + * Export the database to the output stream in a given format. + * + * @throws IOException, InterruptedException + */ + @Throws(IOException::class, InterruptedException::class) + fun exportData( + context: Context, + database: SQLiteDatabase, + output: OutputStream, + password: CharArray + ) +} diff --git a/app/src/main/java/protect/card_locker/importexport/ImportExportResultType.java b/app/src/main/java/protect/card_locker/importexport/ImportExportResultType.java deleted file mode 100644 index 940488b1a..000000000 --- a/app/src/main/java/protect/card_locker/importexport/ImportExportResultType.java +++ /dev/null @@ -1,7 +0,0 @@ -package protect.card_locker.importexport; - -public enum ImportExportResultType { - Success, - GenericFailure, - BadPassword; -} \ No newline at end of file diff --git a/app/src/main/java/protect/card_locker/importexport/ImportExportResultType.kt b/app/src/main/java/protect/card_locker/importexport/ImportExportResultType.kt new file mode 100644 index 000000000..6f5a57580 --- /dev/null +++ b/app/src/main/java/protect/card_locker/importexport/ImportExportResultType.kt @@ -0,0 +1,7 @@ +package protect.card_locker.importexport + +enum class ImportExportResultType { + Success, + GenericFailure, + BadPassword +} \ No newline at end of file diff --git a/app/src/main/java/protect/card_locker/importexport/Importer.java b/app/src/main/java/protect/card_locker/importexport/Importer.java deleted file mode 100644 index 72c32d377..000000000 --- a/app/src/main/java/protect/card_locker/importexport/Importer.java +++ /dev/null @@ -1,27 +0,0 @@ -package protect.card_locker.importexport; - -import android.content.Context; -import android.database.sqlite.SQLiteDatabase; - -import org.json.JSONException; - -import java.io.File; -import java.io.IOException; -import java.text.ParseException; - -import protect.card_locker.FormatException; - -/** - * Interface for a class which can import the contents of a stream - * into the database. - */ -public interface Importer { - /** - * Import data from the input stream in a given format into - * the database. - * - * @throws IOException - * @throws FormatException - */ - void importData(Context context, SQLiteDatabase database, File inputFile, char[] password) throws IOException, FormatException, InterruptedException, JSONException, ParseException; -} diff --git a/app/src/main/java/protect/card_locker/importexport/Importer.kt b/app/src/main/java/protect/card_locker/importexport/Importer.kt new file mode 100644 index 000000000..599a3f46d --- /dev/null +++ b/app/src/main/java/protect/card_locker/importexport/Importer.kt @@ -0,0 +1,39 @@ +package protect.card_locker.importexport + +import android.content.Context +import android.database.sqlite.SQLiteDatabase +import org.json.JSONException +import protect.card_locker.FormatException +import java.io.File +import java.io.IOException +import java.text.ParseException + +/** + * Interface for a class which can import the contents of a stream + * into the database. + */ +interface Importer { + /** + * Import data from the input stream in a given format into + * the database. + * + * @throws IOException + * @throws FormatException + * @throws InterruptedException + * @throws JSONException + * @throws ParseException + */ + @Throws( + IOException::class, + FormatException::class, + InterruptedException::class, + JSONException::class, + ParseException::class + ) + fun importData( + context: Context, + database: SQLiteDatabase, + inputFile: File, + password: CharArray + ) +}