aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-12-20 14:28:00 +0300
committerGravatar Vitaly Takmazov2016-12-20 14:28:00 +0300
commit3859c9616d0a7a04e68427d173b863161b818140 (patch)
treecba4d1aea88b7ce0d94cbc30fc05f765c9faaa15 /juick-api/src
parent8b02f969d3a09e39557474eb90ec821d550e3b1b (diff)
StringUtils.EMPTY
Diffstat (limited to 'juick-api/src')
-rw-r--r--juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java3
-rw-r--r--juick-api/src/main/java/com/juick/api/controllers/Post.java4
2 files changed, 4 insertions, 3 deletions
diff --git a/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java b/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java
index b4b9df57..409734e4 100644
--- a/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java
+++ b/juick-api/src/main/java/com/juick/api/configuration/ApiAppConfiguration.java
@@ -2,6 +2,7 @@ package com.juick.api.configuration;
import com.juick.api.ApiServer;
import com.juick.api.TGBot;
+import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
@@ -25,6 +26,6 @@ public class ApiAppConfiguration {
@Bean
public TGBot tgBot() {
- return new TGBot(env.getProperty("telegram_token", ""));
+ return new TGBot(env.getProperty("telegram_token", StringUtils.EMPTY));
}
}
diff --git a/juick-api/src/main/java/com/juick/api/controllers/Post.java b/juick-api/src/main/java/com/juick/api/controllers/Post.java
index 853a60ff..0c93fb7b 100644
--- a/juick-api/src/main/java/com/juick/api/controllers/Post.java
+++ b/juick-api/src/main/java/com/juick/api/controllers/Post.java
@@ -65,7 +65,7 @@ public class Post {
if (body == null || body.length() < 1 || body.length() > 4096) {
throw new HttpBadRequestException();
}
- body = body.replace("\r", "");
+ body = body.replace("\r", StringUtils.EMPTY);
String attachmentFName = HttpUtils.receiveMultiPartFile(attach, env.getProperty("upload_tmp_dir",
"/var/www/juick.com/i/tmp/"));
@@ -129,7 +129,7 @@ public class Post {
if (body == null || body.length() < 1 || body.length() > 4096) {
throw new HttpBadRequestException();
}
- body = body.replace("\r", "");
+ body = body.replace("\r", StringUtils.EMPTY);
if ((msg.ReadOnly && msg.getUser().getUid() != vuid) || userService.isInBLAny(msg.getUser().getUid(), vuid)
|| (reply != null && userService.isInBLAny(reply.getUser().getUid(), vuid))) {