Class FileManagerHelper


  • public class FileManagerHelper
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void copy​(java.nio.file.Path sourcePath, java.nio.file.Path destinationPath)  
      static void createDirectory​(java.nio.file.Path path)  
      static void delete​(java.nio.file.Path path)  
      static byte[] downloadFile​(java.nio.file.Path path)  
      static java.util.List<java.io.File> findByPath​(java.nio.file.Path path)  
      static java.util.List<java.io.File> findRootFolders​(java.nio.file.Path rootPath)  
      static java.nio.file.Path getPathFromPathInfo​(java.lang.String root, java.util.List<DePathInfoPart> pathInfo, java.lang.String... furtherPath)  
      static java.nio.file.Path getPathFromPathInfoAllowEmpty​(java.lang.String root, java.util.List<DePathInfoPart> pathInfo, java.lang.String... furtherPath)  
      static void move​(java.nio.file.Path source, java.nio.file.Path destination)  
      static void rename​(java.nio.file.Path path, java.lang.String newName)  
      static void saveContentToFile​(java.lang.String name, java.lang.String path, java.lang.String content)  
      static MsmFileBean toMsmFileBean​(java.io.File file, java.lang.String fileUploadRoot)  
      static void unzip​(java.io.File fileZip, java.io.File destDir)  
      static void unzip​(java.lang.String fileZip, java.lang.String destDirPath)  
      static void unzip​(java.nio.file.Path zipFile, java.nio.file.Path destDirPath)  
      static void uploadFile​(java.nio.file.Path path, java.io.InputStream fis)  
      • Methods inherited from class java.lang.Object

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

      • toMsmFileBean

        public static MsmFileBean toMsmFileBean​(java.io.File file,
                                                java.lang.String fileUploadRoot)
      • unzip

        public static void unzip​(java.io.File fileZip,
                                 java.io.File destDir)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • unzip

        public static void unzip​(java.nio.file.Path zipFile,
                                 java.nio.file.Path destDirPath)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • unzip

        public static void unzip​(java.lang.String fileZip,
                                 java.lang.String destDirPath)
                          throws java.io.IOException
        Throws:
        java.io.IOException
      • getPathFromPathInfoAllowEmpty

        public static java.nio.file.Path getPathFromPathInfoAllowEmpty​(java.lang.String root,
                                                                       java.util.List<DePathInfoPart> pathInfo,
                                                                       java.lang.String... furtherPath)
      • delete

        public static void delete​(java.nio.file.Path path)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • rename

        public static void rename​(java.nio.file.Path path,
                                  java.lang.String newName)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • copy

        public static void copy​(java.nio.file.Path sourcePath,
                                java.nio.file.Path destinationPath)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • move

        public static void move​(java.nio.file.Path source,
                                java.nio.file.Path destination)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • downloadFile

        public static byte[] downloadFile​(java.nio.file.Path path)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • uploadFile

        public static void uploadFile​(java.nio.file.Path path,
                                      java.io.InputStream fis)
                               throws java.io.IOException
        Throws:
        java.io.IOException
      • saveContentToFile

        public static void saveContentToFile​(java.lang.String name,
                                             java.lang.String path,
                                             java.lang.String content)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • findRootFolders

        public static java.util.List<java.io.File> findRootFolders​(java.nio.file.Path rootPath)
      • findByPath

        public static java.util.List<java.io.File> findByPath​(java.nio.file.Path path)
      • createDirectory

        public static void createDirectory​(java.nio.file.Path path)
                                    throws java.io.IOException
        Throws:
        java.io.IOException