Package org.apache.wicket.util.upload

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


   */
  public void testGetInputStream() throws Exception
  {
    IFileUploadCleaner fileUploadCleaner = new FileUploadCleaner();

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

    // Get the internal list out
    Field inputStreamsField = FileUpload.class.getDeclaredField("inputStreamsToClose");
    inputStreamsField.setAccessible(true);

View Full Code Here


    // Loop through items
    for (Iterator<FileItem> i = items.iterator(); i.hasNext();)
    {
      // Get next item
      final FileItem item = i.next();

      // If item is a form field
      if (item.isFormField())
      {
        // Set parameter value
        final String value;
        if (encoding != null)
        {
          try
          {
            value = item.getString(encoding);
          }
          catch (UnsupportedEncodingException e)
          {
            throw new WicketRuntimeException(e);
          }
        }
        else
        {
          value = item.getString();
        }

        addParameter(item.getFieldName(), value);
      }
      else
      {
        // Add to file list
        files.put(item.getFieldName(), item);
      }
    }
  }
View Full Code Here

    // If we successfully installed a multipart request
    if (request instanceof IMultipartWebRequest)
    {
      // Get the item for the path
      final FileItem item = ((IMultipartWebRequest)request).getFile(getInputName());

      // Only update the model when there is a file (larger than zero
      // bytes)
      if (item != null && item.getSize() > 0)
      {
        if (fileUpload == null)
        {
          fileUpload = new FileUpload(item);
        }
View Full Code Here

    // If we successfully installed a multipart request
    if (request instanceof IMultipartWebRequest)
    {
      // Get the item for the path
      final FileItem item = ((IMultipartWebRequest)request).getFile(getInputName());

      // Only update the model when there is a file (larger than zero
      // bytes)
      if (item != null && item.getSize() > 0)
      {
        if (fileUpload == null)
        {
          fileUpload = new FileUpload(item);
        }
View Full Code Here

   */
  public void testGetInputStream() 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
    Field inputStreamsField = FileUpload.class.getDeclaredField("inputStreamsToClose");
    inputStreamsField.setAccessible(true);

View Full Code Here

    // If we successfully installed a multipart request
    if (request instanceof IMultipartWebRequest)
    {
      // Get the item for the path
      final FileItem item = ((IMultipartWebRequest)request).getFile(getInputName());

      // Only update the model when there is a file (larger than zero
      // bytes)
      if (item != null && item.getSize() > 0)
      {
        if (fileUpload == null)
        {
          fileUpload = new FileUpload(item);
        }
View Full Code Here

        {
          // iterate over the map and build the list of filenames

          final Entry entry = (Entry)it.next();
          final String name = (String)entry.getKey();
          final FileItem item = (FileItem)entry.getValue();

          if (!Strings.isEmpty(name) &&
              name.startsWith(getInputName() + MAGIC_SEPARATOR) &&
              !Strings.isEmpty(item.getName()))
          {

            // make sure the fileitem belongs to this component and
            // is not empty
View Full Code Here

    // If we successfully installed a multipart request
    if (request instanceof IMultipartWebRequest)
    {
      // Get the item for the path
      final FileItem item = ((IMultipartWebRequest)request).getFile(getInputName());

      // Only update the model when there is a file (larger than zero
      // bytes)
      if (item != null && item.getSize() > 0)
      {
        if (fileUpload == null)
        {
          fileUpload = new FileUpload(item);
        }
View Full Code Here

    // If we successfully installed a multipart request
    if (request instanceof IMultipartWebRequest)
    {
      // Get the item for the path
      final FileItem item = ((IMultipartWebRequest)request).getFile(getInputName());

      // Only update the model when there is a file (larger than zero
      // bytes)
      if (item != null && item.getSize() > 0)
      {
        if (fileUpload == null)
        {
          fileUpload = new FileUpload(item);
        }
View Full Code Here

    // If we successfully installed a multipart request
    if (request instanceof IMultipartWebRequest)
    {
      // Get the item for the path
      final FileItem item = ((IMultipartWebRequest)request).getFile(getInputName());

      // Only update the model when there is a file (larger than zero
      // bytes)
      if (item != null && item.getSize() > 0)
      {
        if (fileUpload == null)
        {
          fileUpload = new FileUpload(item);
        }
View Full Code Here

TOP

Related Classes of org.apache.wicket.util.upload.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.