List of usage examples for org.apache.hadoop.fs AbstractFileSystem delete
public abstract boolean delete(final Path f, final boolean recursive) throws AccessControlException, FileNotFoundException, UnresolvedLinkException, IOException;
From source file:org.apache.ignite.internal.processors.hadoop.impl.igfs.HadoopIgfsUtils.java
License:Apache License
/** * Deletes all files from the given file system. * * @param fs The file system to clean up. * @throws IOException On error.//from w w w . ja va2 s . c om */ public static void clear(AbstractFileSystem fs) throws IOException { // Delete root contents: FileStatus[] statuses = fs.listStatus(new Path("/")); if (statuses != null) { for (FileStatus stat : statuses) fs.delete(stat.getPath(), true); } }