Added other stuff.
This commit is contained in:
parent
8d11279b6e
commit
f76f080311
|
@ -5,10 +5,13 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The service that manages storing and retrieving files from a base filesystem.
|
||||||
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class FileService {
|
public class FileService {
|
||||||
@Value("${app.files.storage-dir}")
|
@Value("${app.files.storage-dir}")
|
||||||
|
@ -32,6 +35,10 @@ public class FileService {
|
||||||
return tempFile;
|
return tempFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Path saveToStorage(String filename, InputStream in) throws IOException {
|
||||||
|
throw new RuntimeException("Not implemented!");
|
||||||
|
}
|
||||||
|
|
||||||
private Path getStorageDir() throws IOException {
|
private Path getStorageDir() throws IOException {
|
||||||
Path dir = Path.of(storageDir);
|
Path dir = Path.of(storageDir);
|
||||||
if (Files.notExists(dir)) {
|
if (Files.notExists(dir)) {
|
||||||
|
|
Loading…
Reference in New Issue