Example usage for org.apache.hadoop.hdfs DFSClient delete

List of usage examples for org.apache.hadoop.hdfs DFSClient delete

Introduction

In this page you can find the example usage for org.apache.hadoop.hdfs DFSClient delete.

Prototype

public boolean delete(String src, boolean recursive) throws IOException 

Source Link

Document

delete file or directory.

Usage

From source file:org.opencloudengine.flamingo.mapreduce.util.HdfsUtils.java

License:Apache License

/**
 *   .//from  w w  w.  j a  v a 2  s.  co m
 *
 * @param client    DFS Client
 * @param path       
 * @param recursive Recusive ? 
 * @return  <tt>true</tt>
 * @throws java.io.IOException ??    
 */
public static boolean remove(DFSClient client, String path, boolean recursive) throws IOException {
    if (client.exists(path)) {
        logger.info(" [{}] ??  . Recursive  [{}]", path,
                recursive);
        return client.delete(path, recursive);
    }
    logger.info(" [{}] ??  .", path);
    return false;
}