diff options
author | Vitaly Takmazov | 2021-10-23 08:09:05 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2021-10-23 08:10:06 +0300 |
commit | 4b96a9b2e71b7a67effdd55b26ca532ff849d0ef (patch) | |
tree | 597a9b268622a10b440f3b119c529e624b8fdb62 /src/main/java/com/juick/www/api/Service.java | |
parent | 6b31c254b5a7ab6735c625459ba7936d9b2851e6 (diff) |
ImagesService -> StorageService
img_path -> storage_path property
Diffstat (limited to 'src/main/java/com/juick/www/api/Service.java')
-rw-r--r-- | src/main/java/com/juick/www/api/Service.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/com/juick/www/api/Service.java b/src/main/java/com/juick/www/api/Service.java index fc0132b1..f7c7a4aa 100644 --- a/src/main/java/com/juick/www/api/Service.java +++ b/src/main/java/com/juick/www/api/Service.java @@ -27,6 +27,7 @@ import com.juick.util.HttpBadRequestException; import com.juick.util.HttpForbiddenException; import com.juick.service.EmailService; import com.juick.service.MessagesService; +import com.juick.service.StorageService; import com.juick.service.UserService; import com.juick.service.component.AccountVerificationEvent; import com.juick.service.security.annotation.Visitor; @@ -77,8 +78,8 @@ public class Service { private ApplicationEventPublisher applicationEventPublisher; @Inject private User serviceUser; - @Value("${upload_tmp_dir:#{systemEnvironment['TEMP'] ?: '/tmp'}}") - private String tmpDir; + @Inject + private StorageService storageService; @Value("${banned_emails:}") private String[] ignoredEmails; @Inject @@ -139,7 +140,7 @@ public class Service { try { logger.info("got inputstream: {}", a.getInputStream()); FileOutputStream fos = new FileOutputStream( - Paths.get(tmpDir, attachmentFName[0]).toString()); + Paths.get(storageService.getTemporaryDirectory(), attachmentFName[0]).toString()); IOUtils.copy(a.getInputStream(), fos); fos.close(); } catch (IOException e) { |