类 Files2
- java.lang.Object
-
- net.dongliu.commons.io.Files2
-
public class Files2 extends java.lang.ObjectMore utils for file
-
-
构造器概要
构造器 构造器 说明 Files2()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidcopyFile(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 voidmoveFile(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.StringreadAllString(java.nio.file.Path path, java.nio.charset.Charset charset)Read all file data, to string.static java.lang.StringreaddAllString(java.nio.file.Path path)Read all file data, to string, with utf-8 encoding.
-
-
-
方法详细资料
-
copyFile
public static void copyFile(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... copyOptions) throws java.io.IOExceptionCopy 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.IOExceptionCopy 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.IOExceptionRead all file data, to string.- 参数:
path- the file pathcharset- 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.IOExceptionRead all file data, to string, with utf-8 encoding.- 参数:
path- the file path- 返回:
- the file data as string
- 抛出:
java.io.IOException
-
-