diff options
Diffstat (limited to 'src/main/java/com/juick/XMPPManager.java')
-rw-r--r-- | src/main/java/com/juick/XMPPManager.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/juick/XMPPManager.java b/src/main/java/com/juick/XMPPManager.java index b42b4b9f..be1f8fd6 100644 --- a/src/main/java/com/juick/XMPPManager.java +++ b/src/main/java/com/juick/XMPPManager.java @@ -25,6 +25,7 @@ import com.juick.www.WebApp; import com.juick.util.xmpp.iq.MessageQuery; import com.juick.service.MessagesService; import com.juick.service.PMQueriesService; +import com.juick.service.StorageService; import com.juick.service.UserService; import com.juick.service.component.*; import com.juick.util.MessageUtils; @@ -102,8 +103,8 @@ public class XMPPManager implements NotificationListener { private String componentHost; @Value("${xmpp_password:secret}") private String password; - @Value("${upload_tmp_dir:#{systemEnvironment['TEMP'] ?: '/tmp'}}") - private String tmpDir; + @Inject + private StorageService storageService; @Value("classpath:juick.png") private Resource vCardImage; @@ -199,7 +200,7 @@ public class XMPPManager implements NotificationListener { DigestUtils.md5Hex(String.format("%s-%s", e.getInitiator().toString(), e.getSessionId()).getBytes()), attachmentExtension); if (allowedTypes.contains(attachmentExtension)) { - Path filePath = Paths.get(tmpDir, targetFilename); + Path filePath = Paths.get(storageService.getTemporaryDirectory(), targetFilename); FileTransfer ft = e.accept(filePath).get(); ft.addFileTransferStatusListener(st -> { logger.debug("{}: received {} of {}", e.getName(), st.getBytesTransferred(), e.getSize()); |