aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database/MediaManager.java
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/MediaManager.java
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/MediaManager.java')
-rw-r--r--src/main/java/org/traccar/database/MediaManager.java12
1 files changed, 8 insertions, 4 deletions
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 {