使用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"));
}
}

你可能感兴趣的:(java,hdfs,创建文件夹)