aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/notification/MultiPartEventForwarder.java
diff options
context:
space:
mode:
authorSrk <watertext@hotmail.it>2017-11-23 18:38:33 +0100
committerSrk <watertext@hotmail.it>2017-11-23 18:38:33 +0100
commit00c5cef324ed644ca5cae282864f3bca9629467a (patch)
treeae6672b3467194ff244d4b4d57c6673ffbeee05e /src/org/traccar/notification/MultiPartEventForwarder.java
parent82da12c1218ca7f1e4e1562cc183cc8a059045e6 (diff)
downloadtrackermap-server-00c5cef324ed644ca5cae282864f3bca9629467a.tar.gz
trackermap-server-00c5cef324ed644ca5cae282864f3bca9629467a.tar.bz2
trackermap-server-00c5cef324ed644ca5cae282864f3bca9629467a.zip
Minor refactoring
Diffstat (limited to 'src/org/traccar/notification/MultiPartEventForwarder.java')
-rw-r--r--src/org/traccar/notification/MultiPartEventForwarder.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/org/traccar/notification/MultiPartEventForwarder.java b/src/org/traccar/notification/MultiPartEventForwarder.java
index 6a3baecb3..f4c36d3e4 100644
--- a/src/org/traccar/notification/MultiPartEventForwarder.java
+++ b/src/org/traccar/notification/MultiPartEventForwarder.java
@@ -1,11 +1,10 @@
package org.traccar.notification;
-import static java.nio.charset.StandardCharsets.UTF_8;
+import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import org.apache.commons.lang3.StringUtils;
import org.traccar.Context;
import org.traccar.model.Event;
import org.traccar.model.Position;
@@ -31,16 +30,17 @@ public class MultiPartEventForwarder extends EventForwarder {
@Override
protected void setContent(Event event, Position position, BoundRequestBuilder requestBuilder) {
- if (StringUtils.isNotEmpty(additionalParams)) {
+ if (additionalParams != null && !additionalParams.isEmpty()) {
Map<String, List<String>> paramsToAdd = splitIntoKeyValues(additionalParams, "=");
for (Entry<String, List<String>> param : paramsToAdd.entrySet()) {
for (String singleParamValue : param.getValue()) {
- requestBuilder.addBodyPart(new StringPart(param.getKey(), singleParamValue, null, UTF_8));
+ requestBuilder.addBodyPart(new StringPart(param.getKey(), singleParamValue, null,
+ StandardCharsets.UTF_8));
}
}
}
requestBuilder.addBodyPart(new StringPart(payloadParamName,
- prepareJsonPayload(event, position), "application/json", UTF_8));
+ prepareJsonPayload(event, position), "application/json", StandardCharsets.UTF_8));
}
}