某个接口的设计
FileConnector
public void saveFile(String uploadPath, File[] files)
throws FileNotFoundException;
为什么是File[]?很奇怪,考虑复杂业务是不是太多了?实现类受得了这么折腾吗?
//XXX: 能否就指定文件的path?
public void saveFile(String uploadPath, String fileName,
InputStream inputStream) throws FileNotFoundException;
最后改成:
<T> T read(InputStreamReader<T> reader) throws IOException;
void write(OutputStreamWriter writer) throws IOException;