Liuyt_61

愿踏遍山河,仍觉人间值得

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

所有操作都是以fileSystem为入口进行,我们使用fileSystem下的delete方法进行删除文件操作,删除的时候必须慎重。

直接上代码:

  /**
     * 删除文件
     * @throws Exception
     */
    @Test
    public void delete() throws Exception{
        Boolean result = fileSystem.delete(new Path("/hdfsapi/test/jdk.zip"),true);
        System.out.println(result);
    }

每一步操作为什么都类似于之前,详解回顾:https://www.cnblogs.com/Liuyt-61/p/10737466.html

posted on 2019-04-20 21:57  Liuyt_61  阅读(784)  评论(0编辑  收藏  举报