aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-05-30 11:49:39 -0700
committerAnton Tananaev <anton@traccar.org>2022-05-30 11:49:39 -0700
commit154ff3b2175e67b3fac531cb9c5c5c68880f5e12 (patch)
treef448a59c75b64deea60b1bd6e79d66790f62a4a8 /src/main/java/org/traccar/database
parentb1a971eedb18a11af2cdc70ba5f8004bae89defd (diff)
downloadtrackermap-server-154ff3b2175e67b3fac531cb9c5c5c68880f5e12.tar.gz
trackermap-server-154ff3b2175e67b3fac531cb9c5c5c68880f5e12.tar.bz2
trackermap-server-154ff3b2175e67b3fac531cb9c5c5c68880f5e12.zip
Inject media manager
Diffstat (limited to 'src/main/java/org/traccar/database')
-rw-r--r--src/main/java/org/traccar/database/GroupsManager.java3
-rw-r--r--src/main/java/org/traccar/database/MediaManager.java12
2 files changed, 9 insertions, 6 deletions
diff --git a/src/main/java/org/traccar/database/GroupsManager.java b/src/main/java/org/traccar/database/GroupsManager.java
index 9322dd80a..4df848042 100644
--- a/src/main/java/org/traccar/database/GroupsManager.java
+++ b/src/main/java/org/traccar/database/GroupsManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 - 2020 Anton Tananaev (anton@traccar.org)
+ * Copyright 2017 - 2022 Anton Tananaev (anton@traccar.org)
* Copyright 2017 Andrey Kunitsyn (andrey@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,7 +19,6 @@ package org.traccar.database;
import java.util.HashSet;
import java.util.Set;
-import org.traccar.Context;
import org.traccar.model.Group;
import org.traccar.storage.StorageException;
diff --git a/src/main/java/org/traccar/database/MediaManager.java b/src/main/java/org/traccar/database/MediaManager.java
index edade5766..5f3fdcdf7 100644
--- a/src/main/java/org/traccar/database/MediaManager.java
+++ b/src/main/java/org/traccar/database/MediaManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 - 2018 Anton Tananaev (anton@traccar.org)
+ * Copyright 2017 - 2022 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,7 +18,10 @@ package org.traccar.database;
import io.netty.buffer.ByteBuf;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.traccar.config.Config;
+import org.traccar.config.Keys;
+import javax.inject.Inject;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -34,10 +37,11 @@ public class MediaManager {
private static final Logger LOGGER = LoggerFactory.getLogger(MediaManager.class);
- private String path;
+ private final String path;
- public MediaManager(String path) {
- this.path = path;
+ @Inject
+ public MediaManager(Config config) {
+ this.path = config.getString(Keys.MEDIA_PATH);
}
private File createFile(String uniqueId, String name) throws IOException {