使用FileSystem中的delete()方法可以永久性的刪除文件或目錄。
public boolean delete(Path f,boolean recursive) throws IOException
如果 f 是一個空目錄,那麼recursive的值就會被忽略,只有在recursive爲true時,非空目錄及其內容纔會被刪除,否則會拋出IOException異常。
使用FileSystem中的delete()方法可以永久性的刪除文件或目錄。
public boolean delete(Path f,boolean recursive) throws IOException
如果 f 是一個空目錄,那麼recursive的值就會被忽略,只有在recursive爲true時,非空目錄及其內容纔會被刪除,否則會拋出IOException異常。