Package co.mastermindcms.modules.rest
Class FilesController
- java.lang.Object
-
- co.mastermindcms.modules.rest.FilesController
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
@RestController public class FilesController extends java.lang.Object implements org.springframework.beans.factory.InitializingBean
-
-
Field Summary
Fields Modifier and Type Field Description private CommonPropertiescommonPropertiesprivate co.mastermindcms.modules.filestorage.services.FileManagerServicefileManagerServiceprivate static org.slf4j.Loggerloggerprivate com.fasterxml.jackson.databind.ObjectMappermapper
-
Constructor Summary
Constructors Constructor Description FilesController(co.mastermindcms.modules.filestorage.services.FileManagerService fileManagerService, CommonProperties commonProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()org.springframework.http.ResponseEntity<org.springframework.core.io.Resource>downloadMultipleFiles(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)org.springframework.http.ResponseEntity<?>handleCommand(org.springframework.web.multipart.MultipartFile chunk, java.lang.String arguments, co.mastermindcms.modules.filestorage.enums.FileStorageCommand command)org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>>handleCopy(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>>handleCreateDir(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)org.springframework.http.ResponseEntity<org.springframework.core.io.Resource>handleDownload(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)org.springframework.http.ResponseEntity<org.springframework.core.io.Resource>handleDownloadSingleFile(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>>handleExtract(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>>handleFiles(java.lang.String arguments, co.mastermindcms.modules.filestorage.enums.FileStorageCommand command)org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>>handleFolders()org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>>handleMove(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)org.springframework.http.ResponseEntity<java.lang.String>handleReadFile(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>>handleRemove(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>>handleRename(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>>handleShowFiles(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>>handleShowFolders()org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>>handleUploadFiles(org.springframework.web.multipart.MultipartFile chunk, co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
fileManagerService
private final co.mastermindcms.modules.filestorage.services.FileManagerService fileManagerService
-
commonProperties
private final CommonProperties commonProperties
-
mapper
private final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Constructor Detail
-
FilesController
@Autowired public FilesController(co.mastermindcms.modules.filestorage.services.FileManagerService fileManagerService, CommonProperties commonProperties)
-
-
Method Detail
-
handleFiles
@CrossOrigin(origins="*", allowCredentials="false") @GetMapping(value="/api/v1/files", params={"arguments","command"}, produces="application/json") @ResponseBody public org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>> handleFiles(@RequestParam java.lang.String arguments, @RequestParam co.mastermindcms.modules.filestorage.enums.FileStorageCommand command) throws com.fasterxml.jackson.core.JsonProcessingException- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
handleFolders
@CrossOrigin(origins="*", allowCredentials="false") @GetMapping(value="/api/v1/folders", produces="application/json") @ResponseBody public org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>> handleFolders()
-
handleCommand
@CrossOrigin(origins="*", allowCredentials="false") @PostMapping("/api/v1/files") @ResponseBody public org.springframework.http.ResponseEntity<?> handleCommand(@RequestParam(required=false) org.springframework.web.multipart.MultipartFile chunk, @RequestParam java.lang.String arguments, @RequestParam co.mastermindcms.modules.filestorage.enums.FileStorageCommand command) throws java.lang.Exception- Throws:
java.lang.Exception
-
handleUploadFiles
public org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>> handleUploadFiles(org.springframework.web.multipart.MultipartFile chunk, co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)
-
handleCreateDir
public org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>> handleCreateDir(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments) throws co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException- Throws:
co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException
-
handleDownload
public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> handleDownload(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments) throws java.lang.Exception- Throws:
java.lang.Exception
-
handleDownloadSingleFile
public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> handleDownloadSingleFile(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments) throws co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException- Throws:
co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException
-
downloadMultipleFiles
public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> downloadMultipleFiles(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments) throws java.lang.Exception- Throws:
java.lang.Exception
-
handleShowFolders
public org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>> handleShowFolders()
-
handleMove
public org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>> handleMove(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments) throws co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException- Throws:
co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException
-
handleCopy
public org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>> handleCopy(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments) throws co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException- Throws:
co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException
-
handleRename
public org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>> handleRename(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments) throws co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException- Throws:
co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException
-
handleRemove
public org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>> handleRemove(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments) throws co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException- Throws:
co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException
-
handleExtract
public org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>> handleExtract(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments) throws co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException- Throws:
co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException
-
handleReadFile
public org.springframework.http.ResponseEntity<java.lang.String> handleReadFile(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments) throws co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException- Throws:
co.mastermindcms.modules.filestorage.exceptions.EmptyPathInfoException
-
handleShowFiles
public org.springframework.http.ResponseEntity<co.mastermindcms.modules.filestorage.beans.devexpress.DeResponseBody<java.util.List<co.mastermindcms.modules.filestorage.beans.MsmFileBean>>> handleShowFiles(co.mastermindcms.modules.filestorage.beans.devexpress.DeArguments arguments)
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
-