com.scooterframework.common.util
Class FileUtil

java.lang.Object
  extended by com.scooterframework.common.util.FileUtil

public class FileUtil
extends java.lang.Object

FileUtil class has helper methods for files and directories.


Constructor Summary
FileUtil()
           
 
Method Summary
static void copy(java.io.File source, java.io.File target)
           
static void copyDir(java.io.File sourceDir, java.io.File targetDir)
           
static void copyFile(java.io.File oldFile, java.io.File newFile)
           
static boolean pathExist(java.lang.String path)
           
static boolean pathExistAndHasFiles(java.lang.String path)
           
static java.util.List<java.lang.String> readContent(java.io.File file)
           
static boolean rename(java.io.File source, java.io.File target)
           
static boolean rename(java.lang.String parentPathAbsolute, java.lang.String oldName, java.lang.String newName)
           
static void updateFile(java.io.File file, java.util.List<java.lang.String> contentLines)
           
static void updateFile(java.io.File file, java.lang.String content)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil()
Method Detail

pathExist

public static boolean pathExist(java.lang.String path)

pathExistAndHasFiles

public static boolean pathExistAndHasFiles(java.lang.String path)

copy

public static void copy(java.io.File source,
                        java.io.File target)
                 throws java.io.IOException
Throws:
java.io.IOException

copyFile

public static void copyFile(java.io.File oldFile,
                            java.io.File newFile)
                     throws java.io.IOException
Throws:
java.io.IOException

copyDir

public static void copyDir(java.io.File sourceDir,
                           java.io.File targetDir)
                    throws java.io.IOException
Throws:
java.io.IOException

rename

public static boolean rename(java.io.File source,
                             java.io.File target)

rename

public static boolean rename(java.lang.String parentPathAbsolute,
                             java.lang.String oldName,
                             java.lang.String newName)

readContent

public static java.util.List<java.lang.String> readContent(java.io.File file)
                                                    throws java.io.IOException
Throws:
java.io.IOException

updateFile

public static void updateFile(java.io.File file,
                              java.lang.String content)
                       throws java.io.IOException
Throws:
java.io.IOException

updateFile

public static void updateFile(java.io.File file,
                              java.util.List<java.lang.String> contentLines)
                       throws java.io.IOException
Throws:
java.io.IOException