Class FileUtils


  • public class FileUtils
    extends java.lang.Object
    Author:
    Loc Ha
    • Constructor Summary

      Constructors 
      Constructor Description
      FileUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void copyRecursively​(java.nio.file.Path src, java.nio.file.Path dest)  
      static void deleteRecursively​(java.nio.file.Path root)  
      static java.nio.file.Path mkdirs​(java.lang.String dir)  
      static java.lang.String readContent​(java.nio.file.Path src)  
      static java.lang.String readContent​(java.nio.file.Path path, java.nio.charset.Charset charset)  
      static void writeContent​(java.nio.file.Path path, java.lang.String content)  
      static void writeContent​(java.nio.file.Path path, java.lang.String content, java.nio.charset.Charset charset)  
      • Methods inherited from class java.lang.Object

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

      • FileUtils

        public FileUtils()
    • Method Detail

      • mkdirs

        public static java.nio.file.Path mkdirs​(java.lang.String dir)
      • writeContent

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

        public static void writeContent​(java.nio.file.Path path,
                                        java.lang.String content,
                                        java.nio.charset.Charset charset)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • readContent

        public static java.lang.String readContent​(java.nio.file.Path src)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • readContent

        public static java.lang.String readContent​(java.nio.file.Path path,
                                                   java.nio.charset.Charset charset)
                                            throws java.io.IOException
        Throws:
        java.io.IOException
      • deleteRecursively

        public static void deleteRecursively​(java.nio.file.Path root)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • copyRecursively

        public static void copyRecursively​(java.nio.file.Path src,
                                           java.nio.file.Path dest)
                                    throws java.io.IOException
        Throws:
        java.io.IOException