使用Java实现在HDFS中创建文件夹
使用Java实现在HDFS中创建文件夹
package com.njupt.Hadoop;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
public class HDFSMkdir {
public static void main(String[] args) throws Exception {
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(conf);
fs.mkdirs(new Path("/user/root/njupt"));
}
}