Class FileManagerServiceImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.slf4j.Logger logger  
      private static com.fasterxml.jackson.databind.ObjectMapper mapper  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void copy​(java.nio.file.Path sourcePath, java.nio.file.Path destinationPath)
      This method copies a file.
      void createDirectory​(java.nio.file.Path path)
      This method creates a object.
      void delete​(java.nio.file.Path path)
      This method deletes a file.
      byte[] downloadFile​(java.nio.file.Path path)
      This method downloads a file.
      void extractZipFile​(java.nio.file.Path zipFile, java.nio.file.Path destination)
      This method extracts a zip file.
      java.util.List<java.io.File> findByPath​(java.nio.file.Path path)
      This method returns a files list.
      java.util.List<java.io.File> findByPath​(java.nio.file.Path path, java.io.FileFilter filter)
      This method returns a files list.
      java.util.List<java.io.File> findFiles​(java.nio.file.Path path)
      This method returns a files list.
      java.util.List<java.io.File> findFiles​(java.nio.file.Path path, java.lang.String fileExtension)
      This method returns a files list.
      java.util.List<java.io.File> findRootFolders​(java.nio.file.Path rootPath)
      This method returns a files list.
      void move​(java.nio.file.Path source, java.nio.file.Path destination)
      This method moves a file.
      void rename​(java.nio.file.Path path, java.lang.String newName)
      This method updates a file name.
      void saveContentToFile​(java.lang.String name, java.lang.String path, java.lang.String content)
      This method saves content in file.
      void uploadFile​(java.nio.file.Path path, java.io.InputStream fis)
      This method uploads a file.
      • 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
      • mapper

        private static final com.fasterxml.jackson.databind.ObjectMapper mapper
    • Constructor Detail

      • FileManagerServiceImpl

        public FileManagerServiceImpl()
    • Method Detail

      • createDirectory

        public void createDirectory​(java.nio.file.Path path)
        Description copied from interface: FileManagerService
        This method creates a object.
        Specified by:
        createDirectory in interface FileManagerService
        Parameters:
        path - java object, which will be created
      • findByPath

        public java.util.List<java.io.File> findByPath​(java.nio.file.Path path)
        Description copied from interface: FileManagerService
        This method returns a files list.
        Specified by:
        findByPath in interface FileManagerService
        Parameters:
        path - to java object, with which the file will be found
        Returns:
        files as list
      • findByPath

        public java.util.List<java.io.File> findByPath​(java.nio.file.Path path,
                                                       java.io.FileFilter filter)
        Description copied from interface: FileManagerService
        This method returns a files list.
        Specified by:
        findByPath in interface FileManagerService
        Parameters:
        path - to java object, with which the file will be found
        filter - file filter object
        Returns:
        files as list
      • findFiles

        public java.util.List<java.io.File> findFiles​(java.nio.file.Path path)
        Description copied from interface: FileManagerService
        This method returns a files list.
        Specified by:
        findFiles in interface FileManagerService
        Parameters:
        path - to java object, with which the file will be found
        Returns:
        files as list
      • findFiles

        public java.util.List<java.io.File> findFiles​(java.nio.file.Path path,
                                                      java.lang.String fileExtension)
        Description copied from interface: FileManagerService
        This method returns a files list.
        Specified by:
        findFiles in interface FileManagerService
        Parameters:
        path - to java object, with which the file will be found
        fileExtension - extension to filter files
        Returns:
        files as list
      • findRootFolders

        public java.util.List<java.io.File> findRootFolders​(java.nio.file.Path rootPath)
        Description copied from interface: FileManagerService
        This method returns a files list.
        Specified by:
        findRootFolders in interface FileManagerService
        Parameters:
        rootPath - to files, with which the file will be found
        Returns:
        files as list
      • uploadFile

        public void uploadFile​(java.nio.file.Path path,
                               java.io.InputStream fis)
        Description copied from interface: FileManagerService
        This method uploads a file.
        Specified by:
        uploadFile in interface FileManagerService
        Parameters:
        path - path to file, with which the file will be found
        fis - is a stream, with which the file will be uploaded
      • downloadFile

        public byte[] downloadFile​(java.nio.file.Path path)
        Description copied from interface: FileManagerService
        This method downloads a file.
        Specified by:
        downloadFile in interface FileManagerService
        Parameters:
        path - path to file, with which the file will be found
        Returns:
        data as byte array
      • move

        public void move​(java.nio.file.Path source,
                         java.nio.file.Path destination)
        Description copied from interface: FileManagerService
        This method moves a file.
        Specified by:
        move in interface FileManagerService
        Parameters:
        source - path to file, with which the file will be found
        destination - path to file, with which the file will be found
      • copy

        public void copy​(java.nio.file.Path sourcePath,
                         java.nio.file.Path destinationPath)
        Description copied from interface: FileManagerService
        This method copies a file.
        Specified by:
        copy in interface FileManagerService
        Parameters:
        sourcePath - path to file, with which the file will be found
        destinationPath - path to file, with which the file will be found
      • rename

        public void rename​(java.nio.file.Path path,
                           java.lang.String newName)
        Description copied from interface: FileManagerService
        This method updates a file name.
        Specified by:
        rename in interface FileManagerService
        Parameters:
        path - path to file, with which the file will be found
        newName - name value, which will be set file
      • delete

        public void delete​(java.nio.file.Path path)
        Description copied from interface: FileManagerService
        This method deletes a file.
        Specified by:
        delete in interface FileManagerService
        Parameters:
        path - path to file, with which the file will be found
      • extractZipFile

        public void extractZipFile​(java.nio.file.Path zipFile,
                                   java.nio.file.Path destination)
        Description copied from interface: FileManagerService
        This method extracts a zip file.
        Specified by:
        extractZipFile in interface FileManagerService
        Parameters:
        zipFile - path of file, with which the file will be uploaded
        destination - path to file, with which the file will be found
      • saveContentToFile

        public void saveContentToFile​(java.lang.String name,
                                      java.lang.String path,
                                      java.lang.String content)
        Description copied from interface: FileManagerService
        This method saves content in file.
        Specified by:
        saveContentToFile in interface FileManagerService
        Parameters:
        name - is a value, with which the file will be found
        path - path to file, with which the file will be found
        content - content, which will be saved in file