标签:out code interrupt 删除 string txt except exce ring
package com.hadoop.hdfs; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; public class Client { public static void main(String[] args) throws IOException, URISyntaxException, InterruptedException { //1. 获取fs对象 Configuration conf=new Configuration(); FileSystem fs=FileSystem.get(new URI("hdfs://localhost:9000"),conf,"root"); //2. 删除文件API fs.delete(new Path("/example.txt"),,true/*是否递归删除*/); //3.关闭资源 fs.close(); System.out.println("over"); } }
标签:out code interrupt 删除 string txt except exce ring
原文地址:https://www.cnblogs.com/abuduri/p/13192171.html