From f76f0803119bced7a5e19696589db99ee69211ba Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Wed, 1 Feb 2023 08:40:13 +0100 Subject: [PATCH] Added other stuff. --- .../java/nl/andrewlalis/gymboardcdn/FileService.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gymboard-cdn/src/main/java/nl/andrewlalis/gymboardcdn/FileService.java b/gymboard-cdn/src/main/java/nl/andrewlalis/gymboardcdn/FileService.java index 7e52300..88bd847 100644 --- a/gymboard-cdn/src/main/java/nl/andrewlalis/gymboardcdn/FileService.java +++ b/gymboard-cdn/src/main/java/nl/andrewlalis/gymboardcdn/FileService.java @@ -5,10 +5,13 @@ import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import java.io.IOException; +import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Optional; +/** + * The service that manages storing and retrieving files from a base filesystem. + */ @Service public class FileService { @Value("${app.files.storage-dir}") @@ -32,6 +35,10 @@ public class FileService { return tempFile; } + public Path saveToStorage(String filename, InputStream in) throws IOException { + throw new RuntimeException("Not implemented!"); + } + private Path getStorageDir() throws IOException { Path dir = Path.of(storageDir); if (Files.notExists(dir)) {