Package org.apache.wicket.util.upload

Examples of org.apache.wicket.util.upload.DiskFileItemFactory


   *             Thrown if something goes wrong with upload
   */
  public MultipartServletWebRequestImpl(HttpServletRequest request, String filterPrefix,
    Bytes maxSize, String upload) throws FileUploadException
  {
    this(request, filterPrefix, maxSize, upload, new DiskFileItemFactory(Application.get()
      .getResourceSettings()
      .getFileCleaner()));
  }
View Full Code Here


   *             Thrown if something goes wrong with upload
   */
  public MultipartServletWebRequestImpl(HttpServletRequest request, String filterPrefix,
    Bytes maxSize, String upload) throws FileUploadException
  {
    this(request, filterPrefix, maxSize, upload, new DiskFileItemFactory(Application.get()
      .getResourceSettings()
      .getFileCleaner()));
  }
View Full Code Here

  @Test
  public void getInputStream() throws Exception
  {
    IFileCleaner fileUploadCleaner = new FileCleaner();

    FileItem fileItem = new DiskFileItemFactory(fileUploadCleaner).createItem("dummyFieldName",
      "text/java", false, "FileUploadTest.java");
    // Initialize the upload
    fileItem.getOutputStream();

    // Get the internal list out
View Full Code Here

   *             Thrown if something goes wrong with upload
   */
  public MultipartServletWebRequestImpl(HttpServletRequest request, String filterPrefix,
    Bytes maxSize, String upload) throws FileUploadException
  {
    this(request, filterPrefix, maxSize, upload, new DiskFileItemFactory(Application.get()
      .getResourceSettings()
      .getFileCleaner()));
  }
View Full Code Here

   *             Thrown if something goes wrong with upload
   */
  public MultipartServletWebRequestImpl(HttpServletRequest request, String filterPrefix,
    Bytes maxSize) throws FileUploadException
  {
    this(request, filterPrefix, maxSize, new DiskFileItemFactory(Application.get()
      .getResourceSettings()
      .getFileUploadCleaner()));
  }
View Full Code Here

      String fieldName = "pulledFileUpload"// not sure how to get the real value in here...
      String contentType = method.getResponseHeader("Content-Type").getValue();
      String name = url.getPath();
      boolean isFormField = true;

      DiskFileItemFactory factory = new DiskFileItemFactory();
      FileItem fileItem = factory.createItem(fieldName, contentType, isFormField, name);
      IOUtils.copy(method.getResponseBodyAsStream(), fileItem.getOutputStream());

      return new PulledFileUpload(url, fileItem);
    } catch (MalformedURLException e) {
      ConversionException ex = new ConversionException("Can't convert " + value + " into a URL.", e);
View Full Code Here

   *
   * @throws Exception
   */
  public void testGetInputStream() throws Exception
  {
    FileItem fileItem = new DiskFileItemFactory().createItem("dummyFieldName", "text/java", false, "FileUploadTest.java");
    // Initialize the upload
    fileItem.getOutputStream();
   
    // Get the internal list out
    Field inputStreamsField = FileUpload.class.getDeclaredField("inputStreamsToClose");
View Full Code Here

    if (!isMultipart)
    {
      throw new IllegalStateException("ServletRequest does not contain multipart content");
    }

    DiskFileItemFactory factory = new DiskFileItemFactory();

    // Configure the factory here, if desired.
    ServletFileUpload upload = new ServletFileUpload(factory);

    // The encoding that will be used to decode the string parameters
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.upload.DiskFileItemFactory

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.