Added other stuff.

This commit is contained in:
Andrew Lalis 2023-02-01 08:40:13 +01:00
parent 8d11279b6e
commit f76f080311
1 changed files with 8 additions and 1 deletions

View File

@ -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)) {