-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integration of Gmail API and logging
- Loading branch information
Showing
45 changed files
with
968 additions
and
270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
jdk-22/ | ||
res/oauth/*.json | ||
Kilamea.exe | ||
Kilamea.jar | ||
temp.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
## 0.2.0 (2024-06-13) | ||
|
||
- Bundling the tools for processing file attachments in the new `AttachmentConverter` class | ||
- Enhanced the `createNewMessage()` method in Kilamea.kt with the evaluation of application arguments as file attachments | ||
- Added another MIME type `APPLICATION_OCTET_STREAM` | ||
- Context class extended with the `appDataFolder` property and a way to unset command line arguments | ||
- `HelpAppDataFolderAction` introduced to open the directory with application data directly from the client | ||
- Integrated the Gmail API and encapsulated the calls in the new `GmailClient` class | ||
- Enhanced `MailMapper` with methods for converting Gmail messages | ||
- Automatically encode the sender name to UTF-8 when sending emails | ||
- Extended the `Account` class with a "tokens" property (particularly relevant for Gmail) and the database manager with methods for loading and saving OAuth tokens | ||
- Start of a simple logging mechanism (JUL) | ||
- String extensions implemented | ||
- Changed a few button labels | ||
|
||
## 0.1.0 (2024-05-09) | ||
|
||
- Start of the project | ||
- UI-Design | ||
- Implementation of the basic functionality |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.0.xsd"> | ||
|
||
<changeSet id="add_tokens_to_accounts" author="kschroeer"> | ||
<addColumn tableName="accounts"> | ||
<column name="tokens" type="TEXT"> | ||
<constraints nullable="false"/> | ||
</column> | ||
</addColumn> | ||
</changeSet> | ||
|
||
<changeSet id="set_empty_tokens_for_existing_accounts" author="kschroeer"> | ||
<sql>UPDATE accounts SET tokens = '' WHERE tokens IS NULL;</sql> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,67 @@ | ||
package com.github.kilamea | ||
|
||
import java.io.File | ||
import java.io.IOException | ||
import java.util.logging.ConsoleHandler | ||
import java.util.logging.FileHandler | ||
import java.util.logging.Level | ||
import java.util.logging.Logger | ||
import java.util.logging.SimpleFormatter | ||
|
||
import com.github.kilamea.core.Context | ||
import com.github.kilamea.view.Kilamea | ||
|
||
/** | ||
* Main launcher class for the Kilamea application. | ||
* An object containing the main functionality for launching the application. | ||
* | ||
* @since 0.1.0 | ||
*/ | ||
object Launcher { | ||
private val logger = Logger.getLogger(Launcher::class.java.name) | ||
|
||
/** | ||
* Main entry point of the application. | ||
* | ||
* @param args Command-line arguments passed to the application. | ||
* @param args Command line arguments passed to the application. | ||
*/ | ||
@JvmStatic | ||
fun main(args: Array<String>) { | ||
val app = Kilamea(Context(args)) | ||
val context = Context(args) | ||
try { | ||
initLogging(context.logFile) | ||
} catch (e: IOException) { | ||
System.err.println("Failed to initialize logging: ${e.message}") | ||
e.printStackTrace(System.err) | ||
return | ||
} | ||
|
||
logger.info("Starting application...") | ||
val app = Kilamea(context) | ||
app.run() | ||
logger.info("Application has finished running.") | ||
} | ||
|
||
/** | ||
* Initializes logging for the application. | ||
* | ||
* @param logFile The file to which log messages should be written. | ||
* @throws IOException If logging cannot be initialized. | ||
*/ | ||
@Throws(IOException::class) | ||
private fun initLogging(logFile: File) { | ||
val rootLogger = Logger.getLogger("") | ||
rootLogger.handlers.forEach { rootLogger.removeHandler(it) } | ||
|
||
val fileHandler = FileHandler(logFile.toString(), false).apply { | ||
formatter = SimpleFormatter() | ||
} | ||
rootLogger.addHandler(fileHandler) | ||
|
||
val consoleHandler = ConsoleHandler().apply { | ||
formatter = SimpleFormatter() | ||
} | ||
rootLogger.addHandler(consoleHandler) | ||
|
||
rootLogger.level = Level.INFO | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.