HDFS文件系统操作JAVA-API

public class HDFSIO {
   

    /**
     * 创建文件夹
 * @param path
 * @throws IOException
 */

public static void mkdir(String path)throws IOException{

    //读取配置文件 
    Configuration configuration = new Configuration();
    //获取文件系统  
    FileSystem fSystem = FileSystem.get(URI.create("hdfs://192.168.32.128:9000/"), configuration);
    Path srcPath = 
posted @ 2018-01-27 09:13  legolas007  阅读(15)  评论(0)    收藏  举报