Class IOUtils
- java.lang.Object
-
- com.alibaba.nacos.client.config.utils.IOUtils
-
public class IOUtils extends Object
IO Util- Author:
- Nacos
-
-
Constructor Summary
Constructors Constructor Description IOUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcleanDirectory(File directory)清理目录下的内容static longcopy(Reader input, Writer output)static voiddelete(File fileOrDir)static List<String>readLines(Reader input)从输入流读行列表。保证不返回NULL。static StringtoString(InputStream input, String encoding)static StringtoString(Reader reader)static voidwriteStringToFile(File file, String data, String encoding)
-
-
-
Method Detail
-
toString
public static String toString(InputStream input, String encoding) throws IOException
- Throws:
IOException
-
toString
public static String toString(Reader reader) throws IOException
- Throws:
IOException
-
copy
public static long copy(Reader input, Writer output) throws IOException
- Throws:
IOException
-
readLines
public static List<String> readLines(Reader input) throws IOException
从输入流读行列表。保证不返回NULL。- Throws:
IOException
-
delete
public static void delete(File fileOrDir) throws IOException
- Throws:
IOException
-
cleanDirectory
public static void cleanDirectory(File directory) throws IOException
清理目录下的内容- Throws:
IOException
-
writeStringToFile
public static void writeStringToFile(File file, String data, String encoding) throws IOException
- Throws:
IOException
-
-