Package com.elibom.jogger.http

Examples of com.elibom.jogger.http.FileItem


            // create the temp file
            File tempFile = createTempFile(multipartReader);

            // call the part handler
            FileItem fileItem = new FileItem(fieldName, fileName, partContentType, tempFile.length(), tempFile, headers);
            partHandler.handleFileItem(fieldName, fileItem);
          }

          continue;
        }
      } else {
        String fileName = getFileName( headers.get(CONTENT_DISPOSITION) );
        String partContentType = headers.get(CONTENT_TYPE);
        if (fileName != null) {

          // create the temp file
          File tempFile = createTempFile(multipartReader);

          // call the part handler
          FileItem fileItem = new FileItem(currentFieldName, fileName, partContentType, tempFile.length(),
              tempFile, headers);
          partHandler.handleFileItem(currentFieldName, fileItem);
          continue;
        }
      }
View Full Code Here


    return files.toArray( new FileItem[0] );
  }

  public MockRequest addFile(File file, String fileName, String contentType) {
    String fieldName = "file" + files.size();
    files.add( new FileItem(fieldName, fileName, contentType, 0, file, new HashMap<String,String>()) );

    return this;
  }
View Full Code Here

TOP

Related Classes of com.elibom.jogger.http.FileItem

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.