aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexander Alexeev2016-12-11 20:28:50 +0700
committerGravatar Vitaly Takmazov2016-12-11 18:24:38 +0300
commit50309fc6e2362a22ae5d1e892b3c8a6a5ce39686 (patch)
tree069bbc05b1e634b84fd305487bddccd3baefcebe
parent87ce0ec2f1c293bebdf4a015703406359acaede5 (diff)
compile warnings are fixed
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java4
-rw-r--r--juick-crosspost/src/main/java/com/juick/components/Crosspost.java8
2 files changed, 6 insertions, 6 deletions
diff --git a/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java b/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java
index 059a6156..ea645390 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/TelegramWebhook.java
@@ -7,7 +7,6 @@ import com.juick.service.UserService;
import com.pengrad.telegrambot.BotUtils;
import com.pengrad.telegrambot.model.Message;
import com.pengrad.telegrambot.model.Update;
-import org.apache.commons.codec.Charsets;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -20,6 +19,7 @@ import org.springframework.web.bind.annotation.ResponseStatus;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
+import java.nio.charset.StandardCharsets;
import java.util.List;
/**
@@ -39,7 +39,7 @@ public class TelegramWebhook {
@RequestMapping(value = "/tlgmbtwbhk", method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.OK)
public void processUpdate(HttpServletRequest request) throws IOException {
- Update update = BotUtils.parseUpdate(IOUtils.toString(request.getInputStream(), Charsets.UTF_8));
+ Update update = BotUtils.parseUpdate(IOUtils.toString(request.getInputStream(), StandardCharsets.UTF_8));
Message message = update.message();
if (update.message() == null) {
message = update.editedMessage();
diff --git a/juick-crosspost/src/main/java/com/juick/components/Crosspost.java b/juick-crosspost/src/main/java/com/juick/components/Crosspost.java
index c84b50f6..6daa8ddd 100644
--- a/juick-crosspost/src/main/java/com/juick/components/Crosspost.java
+++ b/juick-crosspost/src/main/java/com/juick/components/Crosspost.java
@@ -19,7 +19,6 @@ package com.juick.components;
import com.juick.Tag;
import com.juick.service.CrosspostService;
-import org.apache.commons.codec.Charsets;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
@@ -44,6 +43,7 @@ import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
import java.security.Key;
import java.util.UUID;
@@ -156,7 +156,7 @@ public class Crosspost implements AutoCloseable {
wr.write(body);
wr.close();
- ret = StringUtils.isNotEmpty(IOUtils.toString(conn.getInputStream(), Charsets.UTF_8));
+ ret = StringUtils.isNotEmpty(IOUtils.toString(conn.getInputStream(), StandardCharsets.UTF_8));
conn.disconnect();
} catch (Exception e) {
@@ -193,7 +193,7 @@ public class Crosspost implements AutoCloseable {
wr.write(body);
wr.close();
- ret = StringUtils.isNotEmpty(IOUtils.toString(conn.getInputStream(), Charsets.UTF_8));
+ ret = StringUtils.isNotEmpty(IOUtils.toString(conn.getInputStream(), StandardCharsets.UTF_8));
conn.disconnect();
} catch (Exception e) {
@@ -248,7 +248,7 @@ public class Crosspost implements AutoCloseable {
wr.write("status=" + status);
wr.close();
- ret = IOUtils.toString(conn.getInputStream(), Charsets.UTF_8) != null;
+ ret = IOUtils.toString(conn.getInputStream(), StandardCharsets.UTF_8) != null;
conn.disconnect();
} catch (Exception e) {