nutzwk有没有下载的demo
2 回复
够的,就是想偷懒,所以想看看,有没有现成的,看到有上传文件的
public static void write(File f, Object obj) {
if(null != f && null != obj) {
if(f.isDirectory()) {
throw Lang.makeThrow("Directory '%s' can not be write as File", new Object[]{f});
} else {
try {
if(!f.exists()) {
createNewFile(f);
}
if(obj instanceof InputStream) {
Streams.writeAndClose(Streams.fileOut(f), (InputStream)obj);
} else if(obj instanceof byte[]) {
Streams.writeAndClose(Streams.fileOut(f), (byte[])((byte[])obj));
} else if(obj instanceof Reader) {
Streams.writeAndClose(Streams.fileOutw(f), (Reader)obj);
} else {
Streams.writeAndClose(Streams.fileOutw(f), obj.toString());
}
} catch (IOException var3) {
throw Lang.wrapThrow(var3);
}
}
}
}
添加回复
请先登陆