public abstract class IOUtil extends Object
| 构造器和说明 |
|---|
IOUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static long |
copyInToOut(InputStream from,
OutputStream to)
把InputStream复制到OutputStream
|
static Properties |
fileToProperties(String filePath)
classpath的属性文件转为属性
|
static Properties |
fileToProperties(String filePath,
Class classz)
属性文件转为属性
|
static String |
getDirForCommonUtilFilePath(String filePath)
得到此项目下的文件目录路径
|
static String |
getDirForFilePath(Class classStr,
String filePath)
得到指定Class下的文件的目录
|
static String |
mergeFolderAndFilePath(String folderPath,
String fileName)
合并目录与文件名
|
static String |
slurp(InputStream in)
转换输入流为字符串
|
public static String slurp(InputStream in) throws IOException
in - 输入流IOException - 转换出错public static Properties fileToProperties(String filePath, Class classz)
filePath - 文件路径classz - 要加载属性文件同jar包的类public static Properties fileToProperties(String filePath)
filePath - public static String mergeFolderAndFilePath(String folderPath, String fileName)
folderPath - 目录路径fileName - 文件名public static String getDirForFilePath(Class classStr, String filePath)
classStr - 指定的classfilePath - 文件的相对路径public static String getDirForCommonUtilFilePath(String filePath)
filePath - 文件路径public static long copyInToOut(InputStream from, OutputStream to) throws IOException
from - 输入流to - 输出流IOException - 操作异常Copyright © 2015. All rights reserved.