import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
/***
* 创建文件夹
* @author
*
*/
public class CreateFolder {
public static void main(String[] args) throws IOException, URISyntaxException, InterruptedException {
Configuration conf = new Configuration();
//注意修改为自己的IP
URI uri=new URI("hdfs://192.168.1.100:9000");
FileSystem fs=FileSystem.get(uri,conf,"hadoop");
/**
* uri,conf,"hadoop" 所属于者为hadoop
* uri,conf 所属于者为Windows用户
*/
//创建目录
fs.mkdirs(new Path("/user/hadoop/ccqq/qq/de/ss"));
// fS.mkdirs(new Path("/DataWorld"));
}
}