Revision 34942
Added by Claudio Atzori over 9 years ago
modules/dnet-hadoop-service/trunk/src/main/java/eu/dnetlib/data/hadoop/action/DeleteHdfsPathAction.java | ||
---|---|---|
3 | 3 |
import java.io.IOException; |
4 | 4 |
import java.net.URI; |
5 | 5 |
|
6 |
import org.apache.commons.lang.StringUtils; |
|
6 | 7 |
import org.apache.commons.logging.Log; |
7 | 8 |
import org.apache.commons.logging.LogFactory; |
8 | 9 |
import org.apache.hadoop.conf.Configuration; |
... | ... | |
43 | 44 |
} |
44 | 45 |
|
45 | 46 |
private void delete(final String path, final Configuration conf) throws IOException { |
47 |
if (StringUtils.isBlank(path)) |
|
48 |
throw new IOException("Cannot delete an empty HDFS path."); |
|
46 | 49 |
final FileSystem hdfs = FileSystem.get(conf); |
47 | 50 |
final Path absolutePath = new Path(URI.create(conf.get("fs.defaultFS") + path)); |
48 | 51 |
|
Also available in: Unified diff
fail in case of empty path