Fix ConfigConstants deprecations (#8525)
Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.core.config.core.ConfigConstants;
|
||||
import org.openhab.core.OpenHAB;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@@ -63,7 +63,7 @@ public class ByteArrayFileCache {
|
||||
public ByteArrayFileCache(String servicePID) {
|
||||
// TODO track and limit folder size
|
||||
// TODO support user specific folder
|
||||
cacheFolder = new File(new File(ConfigConstants.getUserDataFolder(), CACHE_FOLDER_NAME), servicePID);
|
||||
cacheFolder = new File(new File(OpenHAB.getUserDataFolder(), CACHE_FOLDER_NAME), servicePID);
|
||||
if (!cacheFolder.exists()) {
|
||||
logger.debug("Creating cache folder '{}'", cacheFolder.getAbsolutePath());
|
||||
cacheFolder.mkdirs();
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.AfterEach;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.openhab.core.config.core.ConfigConstants;
|
||||
import org.openhab.core.OpenHAB;
|
||||
|
||||
/**
|
||||
* Test class for the {@link ByteArrayFileCache} class.
|
||||
@@ -34,7 +34,7 @@ public class ByteArrayFileCacheTest {
|
||||
|
||||
private static final String SERVICE_PID = "org.openhab.binding.kodi";
|
||||
|
||||
private static final File USERDATA_FOLDER = new File(ConfigConstants.getUserDataFolder());
|
||||
private static final File USERDATA_FOLDER = new File(OpenHAB.getUserDataFolder());
|
||||
private static final File CACHE_FOLDER = new File(USERDATA_FOLDER, ByteArrayFileCache.CACHE_FOLDER_NAME);
|
||||
private static final File SERVICE_CACHE_FOLDER = new File(CACHE_FOLDER, SERVICE_PID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user