• 大小: 5.28M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-01
  • 语言: 其他
  • 标签: 其他  

资源简介

yunpan.zip

资源截图

代码片段和文件信息

package com.controller;


import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.mapred.JobConf;

import com.model.HdfsDAO;
import com.sun.security.ntlm.Server;

/**
 * Servlet implementation class DeleteFileServlet
 * 实现删除文件类
 */
public class DeleteFileServlet extends HttpServlet {
 
/**
 * @see HttpServlet#doGet(HttpServletRequest request HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
 

    String filePath = new String(request.getParameter(“filePath“).getBytes(“UTF-8“)“UTF-8“);

  JobConf conf = HdfsDAO.config();
        HdfsDAO hdfs = new HdfsDAO(conf);
        
        hdfs.rmr(filePath);
        System.out.println(“====“+filePath+“====“);
         FileStatus[] list = hdfs.ls(“/123“);
        request.setAttribute(“list“list);
request.getRequestDispatcher(“index.jsp“).forward(requestresponse);

}

/**
 * @see HttpServlet#doPost(HttpServletRequest request HttpServletResponse response)
 */
protected void doPost(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
this.doGet(request response);
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-11-22 15:46  yunpan\
     文件        1570  2017-11-27 10:56  yunpan\.classpath
     文件        1039  2017-11-22 15:46  yunpan\.project
     目录           0  2017-11-24 16:06  yunpan\.settings\
     文件         503  2017-11-22 15:46  yunpan\.settings\.jsdtscope
     文件          88  2017-11-27 16:26  yunpan\.settings\org.eclipse.core.resources.prefs
     文件         364  2017-11-22 15:46  yunpan\.settings\org.eclipse.jdt.core.prefs
     文件         563  2017-11-23 21:26  yunpan\.settings\org.eclipse.wst.common.component
     文件         345  2017-11-22 15:46  yunpan\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2017-11-22 15:46  yunpan\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2017-11-22 15:46  yunpan\.settings\org.eclipse.wst.jsdt.ui.superType.name
     目录           0  2017-11-28 09:52  yunpan\WebContent\
     文件         844  2017-11-27 11:12  yunpan\WebContent\Check.jsp
     目录           0  2017-11-22 15:46  yunpan\WebContent\meta-INF\
     文件          39  2017-11-22 15:46  yunpan\WebContent\meta-INF\MANIFEST.MF
     目录           0  2017-11-27 16:19  yunpan\WebContent\WEB-INF\
     目录           0  2017-11-23 21:26  yunpan\WebContent\WEB-INF\lib\
     文件       70604  2017-11-22 16:07  yunpan\WebContent\WEB-INF\lib\commons-fileupload-1.3.3.jar
     文件      214788  2017-11-22 16:08  yunpan\WebContent\WEB-INF\lib\commons-io-2.6.jar
     文件      999635  2017-11-22 15:51  yunpan\WebContent\WEB-INF\lib\mysql-connector-java-5.1.44-bin.jar
     文件      197994  2017-11-23 21:26  yunpan\WebContent\WEB-INF\lib\servlet-api.jar
     文件        3275  2017-11-29 16:07  yunpan\WebContent\WEB-INF\web.xml
     目录           0  2017-11-23 15:16  yunpan\WebContent\assets\
     目录           0  2017-11-23 15:16  yunpan\WebContent\assets\css\
     文件       46017  2017-11-23 15:16  yunpan\WebContent\assets\css\_bootmetro.css
     文件       32398  2017-11-23 15:16  yunpan\WebContent\assets\css\_metro-ui-dark.css
     文件       31970  2017-11-23 15:16  yunpan\WebContent\assets\css\_metro-ui-light.css
     目录           0  2017-11-23 15:16  yunpan\WebContent\assets\css\bootmetro\
     文件       22898  2017-11-23 15:16  yunpan\WebContent\assets\css\bootmetro\bootmetro-ui-light.css
     文件       73895  2017-11-23 15:16  yunpan\WebContent\assets\css\bootmetro-icons.css
     文件       23126  2017-11-23 15:16  yunpan\WebContent\assets\css\bootmetro-responsive.css
............此处省略153个文件信息

评论

共有 条评论