24 lines
781 B
Java
24 lines
781 B
Java
|
package eu.eudat.managers;
|
||
|
|
||
|
import eu.eudat.models.files.ContentFile;
|
||
|
import eu.eudat.services.helpers.FileStorageService;
|
||
|
import org.springframework.core.io.Resource;
|
||
|
import org.springframework.web.multipart.MultipartFile;
|
||
|
|
||
|
import java.io.IOException;
|
||
|
import java.util.List;
|
||
|
|
||
|
/**
|
||
|
* Created by ikalyvas on 3/15/2018.
|
||
|
*/
|
||
|
public class FileManager {
|
||
|
|
||
|
public static List<ContentFile> saveTempFile(MultipartFile file[], FileStorageService fileStorageService) throws IOException {
|
||
|
return fileStorageService.writeToTempFileSystem(file);
|
||
|
}
|
||
|
|
||
|
public static Resource getFile(String filename, String type, FileStorageService fileStorageService, String location) throws IOException {
|
||
|
return fileStorageService.readFromFilesystem(filename, type, location);
|
||
|
}
|
||
|
}
|