Mastering Hadoop 3
上QQ阅读APP看书,第一时间看更新

HDFS delete 

A user may want to delete files or directories that are already available on HDFS. The FileSystem class provides the delete() method, which can be used to permanently delete files or directories:

public boolean delete(Path filePath, boolean recursive) throws IOException

If the filePath is an empty directory or file, then the value or recursive is ignored and the file or directory is removed. The true value of recursive will delete all the files and directories inside the HDFS path.