aboutsummaryrefslogtreecommitdiff
path: root/juick-xmpp-ft/src/main/java/com
diff options
context:
space:
mode:
authorGravatar Alexander Alexeev2016-11-30 15:10:15 +0700
committerGravatar Alexander Alexeev2016-11-30 15:10:15 +0700
commit1d837a835c04078ec66325e9fb9de21ac401874e (patch)
tree428217d2c617b9caf2eb6d42a7716789881d0937 /juick-xmpp-ft/src/main/java/com
parentb45c000ed478f2407288aab1532425288f998689 (diff)
prevent string concatenation for disabled loggers
Diffstat (limited to 'juick-xmpp-ft/src/main/java/com')
-rw-r--r--juick-xmpp-ft/src/main/java/com/juick/components/XMPPFTServer.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/juick-xmpp-ft/src/main/java/com/juick/components/XMPPFTServer.java b/juick-xmpp-ft/src/main/java/com/juick/components/XMPPFTServer.java
index d411179c..7da2099e 100644
--- a/juick-xmpp-ft/src/main/java/com/juick/components/XMPPFTServer.java
+++ b/juick-xmpp-ft/src/main/java/com/juick/components/XMPPFTServer.java
@@ -40,7 +40,10 @@ public class XMPPFTServer implements AutoCloseable {
FileTransferManager fileTransferManager = component.getManager(FileTransferManager.class);
fileTransferManager.addFileTransferOfferListener(e -> {
try {
- List<String> allowedTypes = new ArrayList<String>() {{ add("png"); add("jpg"); }};
+ List<String> allowedTypes = new ArrayList<String>() {{
+ add("png");
+ add("jpg");
+ }};
String attachmentExtension = FilenameUtils.getExtension(e.getName()).toLowerCase();
String targetFilename = String.format("%s.%s",
DigestUtils.md5Hex(String.format("%s-%s",
@@ -49,7 +52,7 @@ public class XMPPFTServer implements AutoCloseable {
Path filePath = Paths.get(tmpDir, targetFilename);
FileTransfer ft = e.accept(filePath).get();
ft.addFileTransferStatusListener(st -> {
- logger.debug(String.format("%s: received %d of %d", e.getName(), st.getBytesTransferred(), e.getSize()));
+ logger.debug("{}: received {} of {}", e.getName(), st.getBytesTransferred(), e.getSize());
if (ft.isDone()) {
logger.info("transfer completed");
Message msg = new Message();