Package org.apache.commons.fileupload

Examples of org.apache.commons.fileupload.FileItemFactory


    /**
     * Get the form data from the inbound request.
     */
    @SuppressWarnings("rawtypes")
    public static FormData getFormData(HttpServletRequest request) {
        FileItemFactory factory = new DiskFileItemFactory();
        ServletFileUpload upload = new ServletFileUpload( factory );
        upload.setHeaderEncoding( "UTF-8" );

        FormData data = new FormData();
        try {
View Full Code Here


    String physicalPath = getPhysicalPath(path);   
   
    HttpServletRequest httpServletRequest = ((FileUploadInputStream)is).getHttpServletRequest();
       
    // Create a factory for disk-based file items
    FileItemFactory factory = new DiskFileItemFactory();
    // Create a new file upload handler
    ServletFileUpload upload = new ServletFileUpload(factory);
    upload.setSizeMax(-1);

    List /* FileItem */ items = null;
View Full Code Here

  }

  @Override
  public void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
    try {
      FileItemFactory factory = new DiskFileItemFactory();

      // Create a new file upload handler
      ServletFileUpload upload = new ServletFileUpload(factory);

      String uri = null, prefix = null, format = null, projectId = null, filename="";
View Full Code Here

    }
  }

  @Override
  protected ReconciliationService getReconciliationService(HttpServletRequest request) throws JSONException, IOException {
    FileItemFactory factory = new DiskFileItemFactory();

    // Create a new file upload handler
    ServletFileUpload upload = new ServletFileUpload(factory);

    // Parse the request
View Full Code Here

                return;
            }

             try {
                // Create a factory for disk-based file items
                FileItemFactory factory = new DiskFileItemFactory();

                // Create a new file upload handler
                ServletFileUpload upload = new ServletFileUpload(factory);

                // Parse the request
View Full Code Here

  private boolean handleMultiparRequest(String appName, HttpServletRequest request) throws Exception
  {
    boolean responseHandled = false;
    String command = "";

    FileItemFactory factory = new DiskFileItemFactory();
    ServletFileUpload upload = new ServletFileUpload(factory);
    List<?> items = upload.parseRequest(request);

    String namespace = "";
    File zipFile = null;
View Full Code Here

      UploadListener listener = new UploadListener(request.getContentLength());
      listener.start();//启动监听状态
      //将监听器对象的状态保存在Session中
      session.setAttribute("FILE_UPLOAD_STATS", listener.getFileUploadStats());
      //创建MonitoredDiskFileItemFactory对象
      FileItemFactory factory = new MonitoredDiskFileItemFactory(listener);
      //通过该工厂对象创建ServletFileUpload对象
      ServletFileUpload upload = new ServletFileUpload(factory);
      //将转化请求保存到list对象中
      List items = upload.parseRequest(request);
      //停止使用监听器
View Full Code Here

    /**
     * Get the form data from the inbound request.
     */
    public static FormData getFormData(HttpServletRequest request) {
        FileItemFactory factory = new DiskFileItemFactory();
        ServletFileUpload upload = new ServletFileUpload( factory );

        FormData data = new FormData();
        try {
            List items = upload.parseRequest( request );
View Full Code Here

    public void intercept(InterceptorStack stack, ResourceMethod method, Object instance)
        throws InterceptionException {
        logger.info("Request contains multipart data. Try to parse with commons-upload.");

        FileItemFactory factory = createFactoryForDiskBasedFileItems(config.getDirectory());

        ServletFileUpload uploader = fileUploadCreator.create(factory);
        uploader.setSizeMax(config.getSizeLimit());

        try {
View Full Code Here

  }

  public void intercept(InterceptorStack stack, ResourceMethod method, Object instance) throws InterceptionException {
    logger.info("Request contains multipart data. Try to parse with commons-upload.");

    FileItemFactory factory = createFactoryForDiskBasedFileItems(config.getDirectory());
    indexes = HashMultiset.create();

    ServletFileUpload uploader = fileUploadCreator.create(factory);
    uploader.setSizeMax(config.getSizeLimit());
View Full Code Here

TOP

Related Classes of org.apache.commons.fileupload.FileItemFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.