Refactor code for clarity and consistent formatting:
- Added missing braces in the shutdown hook. - Removed unnecessary empty lines. - Streamlined `try` block indentation in `loadConfiguration()`.
This commit is contained in:
parent
ed2f197c60
commit
b0c45bf657
|
|
@ -35,6 +35,7 @@ public class MediaManagerApplication {
|
||||||
logger.info("Shutting down MediaManager Core...");
|
logger.info("Shutting down MediaManager Core...");
|
||||||
if (databaseManager != null) {
|
if (databaseManager != null) {
|
||||||
databaseManager.close();
|
databaseManager.close();
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Cleanup resources
|
// TODO: Cleanup resources
|
||||||
|
|
||||||
|
|
@ -43,7 +44,6 @@ public class MediaManagerApplication {
|
||||||
Thread.sleep(500);
|
Thread.sleep(500);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
|
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
logger.info("Application is running");
|
logger.info("Application is running");
|
||||||
|
|
@ -64,8 +64,7 @@ public class MediaManagerApplication {
|
||||||
|
|
||||||
private static void loadConfiguration() throws IOException {
|
private static void loadConfiguration() throws IOException {
|
||||||
config = new Properties();
|
config = new Properties();
|
||||||
try (InputStream input = MediaManagerApplication.class.getClassLoader()
|
try (InputStream input = MediaManagerApplication.class.getClassLoader().getResourceAsStream("config.properties")) {
|
||||||
.getResourceAsStream("config.properties")) {
|
|
||||||
if (input == null) {
|
if (input == null) {
|
||||||
throw new IOException("Unable to find config.properties");
|
throw new IOException("Unable to find config.properties");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue