Class FilesController

  • All Implemented Interfaces:
    org.springframework.beans.factory.InitializingBean

    @RestController
    public class FilesController
    extends java.lang.Object
    implements org.springframework.beans.factory.InitializingBean
    • 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
      void afterPropertiesSet()  
      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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        private static final org.slf4j.Logger logger
      • fileManagerService

        private final co.mastermindcms.modules.filestorage.services.FileManagerService fileManagerService
      • 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:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception