From 79b3c9dd2a5ad82010ebabcd9a15bd52a1a2b765 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 2 Oct 2022 08:46:10 -0700 Subject: Remove duplicate class --- .../java/org/traccar/api/ObjectMapperProvider.java | 37 ---------------------- src/main/java/org/traccar/web/WebServer.java | 4 +-- 2 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 src/main/java/org/traccar/api/ObjectMapperProvider.java diff --git a/src/main/java/org/traccar/api/ObjectMapperProvider.java b/src/main/java/org/traccar/api/ObjectMapperProvider.java deleted file mode 100644 index d63a4b9b0..000000000 --- a/src/main/java/org/traccar/api/ObjectMapperProvider.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2015 - 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. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.traccar.api; - -import com.fasterxml.jackson.databind.ObjectMapper; - -import javax.inject.Inject; -import javax.ws.rs.ext.ContextResolver; - -public class ObjectMapperProvider implements ContextResolver { - - private final ObjectMapper objectMapper; - - @Inject - public ObjectMapperProvider(ObjectMapper objectMapper) { - this.objectMapper = objectMapper; - } - - @Override - public ObjectMapper getContext(Class type) { - return objectMapper; - } - -} diff --git a/src/main/java/org/traccar/web/WebServer.java b/src/main/java/org/traccar/web/WebServer.java index a7ac4d6b2..79d19cc9b 100644 --- a/src/main/java/org/traccar/web/WebServer.java +++ b/src/main/java/org/traccar/web/WebServer.java @@ -45,12 +45,12 @@ import org.slf4j.LoggerFactory; import org.traccar.LifecycleObject; import org.traccar.api.CorsResponseFilter; import org.traccar.api.DateParameterConverterProvider; -import org.traccar.api.ObjectMapperProvider; import org.traccar.api.ResourceErrorHandler; import org.traccar.api.resource.ServerResource; import org.traccar.api.security.SecurityRequestFilter; import org.traccar.config.Config; import org.traccar.config.Keys; +import org.traccar.helper.ObjectMapperContextResolver; import javax.servlet.DispatcherType; import javax.servlet.ServletException; @@ -178,7 +178,7 @@ public class WebServer implements LifecycleObject { ResourceConfig resourceConfig = new ResourceConfig(); resourceConfig.registerClasses( JacksonFeature.class, - ObjectMapperProvider.class, + ObjectMapperContextResolver.class, DateParameterConverterProvider.class, SecurityRequestFilter.class, CorsResponseFilter.class, -- cgit v1.2.3