public abstract class IOUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
LINE_SEPARATOR |
static String |
LINE_SEPARATOR2 |
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
copy(File sourceFile,
File targetFile)
复制文件
|
static void |
createFile(File newFile,
String text)
创建文件
|
static long |
getFileLastModified(File file)
读取文件最近一次修改时间。
|
static String |
getFileTxt(File file)
读取文本文件内容
|
static String |
getInputStreamTxt(InputStream is)
读取流文本内容
|
public static final String LINE_SEPARATOR
public static final String LINE_SEPARATOR2
@Nullable public static String getFileTxt(File file)
file - 文本文件public static String getInputStreamTxt(InputStream is)
is - 输入流public static void copy(File sourceFile, File targetFile) throws IOException
sourceFile - 源文件targetFile - 目标文件IOException - IO异常public static void createFile(File newFile, String text) throws IOException
newFile - 文件text - 文件内容IOException - IO异常public static long getFileLastModified(File file)
file - 文件Copyright © 2021–2022 EasyJ开源社区. All rights reserved.