摘要:
createTempDir()之后就没有什么有意思的函数了,基本上都是对Java IO函数操作的聚合,只看一个simplifyPath() /** * Returns the lexically cleaned form of the path name, usually (but * not always) equivalent to the original. The following heuristics are used: * * * empty string becomes . * . stays as . * fol... 阅读全文
摘要:
Files中的工厂Files类中对InputStream, OutputStream以及Reader,Writer的操作封装了抽象工厂模式,抽象工厂是InputSupplier与OutputSupplier,具体工厂是Files中的newInputStreamSupplier(),newOutputStreamSupplier()等方法而InputStream, OutputStream以及Reader,Writer则是抽象产品, 他们的各种实现和装饰器包装则为具体产品Input与Output工厂Files中将Input与Output(包括InputStream,OutputStream和Re 阅读全文