类 Files2


  • public class Files2
    extends java.lang.Object
    More utils for file
    • 构造器概要

      构造器 
      构造器 说明
      Files2()  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static void copyFile​(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... copyOptions)
      Copy source file to target file, make target dirs if need.
      static void moveFile​(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... copyOptions)
      Copy source file to target file, make target dirs if need.
      static java.lang.String readAllString​(java.nio.file.Path path, java.nio.charset.Charset charset)
      Read all file data, to string.
      static java.lang.String readdAllString​(java.nio.file.Path path)
      Read all file data, to string, with utf-8 encoding.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • Files2

        public Files2()
    • 方法详细资料

      • copyFile

        public static void copyFile​(java.nio.file.Path source,
                                    java.nio.file.Path target,
                                    java.nio.file.CopyOption... copyOptions)
                             throws java.io.IOException
        Copy source file to target file, make target dirs if need. If target file already exits, override it.
        抛出:
        java.io.IOException
      • moveFile

        public static void moveFile​(java.nio.file.Path source,
                                    java.nio.file.Path target,
                                    java.nio.file.CopyOption... copyOptions)
                             throws java.io.IOException
        Copy source file to target file, make target dirs if need. If target file already exits, override it.
        抛出:
        java.io.IOException
      • readAllString

        public static java.lang.String readAllString​(java.nio.file.Path path,
                                                     java.nio.charset.Charset charset)
                                              throws java.io.IOException
        Read all file data, to string.
        参数:
        path - the file path
        charset - the charset of file
        返回:
        the file data as string
        抛出:
        java.io.IOException
      • readdAllString

        public static java.lang.String readdAllString​(java.nio.file.Path path)
                                               throws java.io.IOException
        Read all file data, to string, with utf-8 encoding.
        参数:
        path - the file path
        返回:
        the file data as string
        抛出:
        java.io.IOException