Package com.almis.awe.tools.service
Class FileManagerService
- java.lang.Object
-
- com.almis.awe.tools.service.FileManagerService
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
public class FileManagerService extends Object implements org.springframework.beans.factory.InitializingBean
File Manager service
-
-
Constructor Summary
Constructors Constructor Description FileManagerService(BaseConfigProperties baseConfigProperties)FileManager service constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()Class initializationFiledownloadAsZipFile(String[] toFilename, String[] items)Download multiple files and zip themFiledownloadFile(String path, String preview)Download preview filecom.fasterxml.jackson.databind.JsonNodeerror(Exception ex)Build json error responsecom.fasterxml.jackson.databind.JsonNodefileOperation(com.fasterxml.jackson.databind.node.ObjectNode params)Manage file manager operationcom.fasterxml.jackson.databind.JsonNodeuploadFile(String destination, List<org.springframework.web.multipart.MultipartFile> files)Upload file
-
-
-
Constructor Detail
-
FileManagerService
public FileManagerService(BaseConfigProperties baseConfigProperties)
FileManager service constructor- Parameters:
baseConfigProperties- Base configuration properties
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet()
Class initialization- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
downloadFile
public File downloadFile(String path, String preview)
Download preview file- Parameters:
path- File pathpreview- Preview- Returns:
- File
-
downloadAsZipFile
public File downloadAsZipFile(String[] toFilename, String[] items) throws IOException
Download multiple files and zip them- Parameters:
toFilename- File namesitems- Items- Returns:
- File
- Throws:
IOException- Error downloading as zip file
-
uploadFile
public com.fasterxml.jackson.databind.JsonNode uploadFile(String destination, List<org.springframework.web.multipart.MultipartFile> files)
Upload file- Parameters:
destination- Destinationfiles- Files- Returns:
- Json node
-
fileOperation
public com.fasterxml.jackson.databind.JsonNode fileOperation(com.fasterxml.jackson.databind.node.ObjectNode params)
Manage file manager operation- Parameters:
params- Parameters- Returns:
- Response
-
error
public com.fasterxml.jackson.databind.JsonNode error(Exception ex)
Build json error response- Parameters:
ex- Exception- Returns:
- Error message
-
-