All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.genexus.webpanels.FileItemCollection Maven / Gradle / Ivy

Go to download

Core classes for the runtime used by Java and Android apps generated with GeneXus

There is a newer version: 4.7.3
Show newest version
package com.genexus.webpanels;

import java.io.InputStream;
import java.util.Vector;

import com.genexus.PrivateUtilities;
import com.genexus.fileupload.IFileItemIterator;
import com.genexus.fileupload.IFileItemStream;
import com.genexus.specific.java.FileUtils;


public class FileItemCollection
{
  protected Vector vector;

  public FileItemCollection( IFileItemIterator lstParts, String rootPath)
  {	  
    vector = new Vector();
    if (lstParts != null)
    {
        try
        {
            while (lstParts.hasNext()) 
            {
                IFileItemStream item = lstParts.next();
                String formFieldNameWithExtension = item.getName();
                String temporalFilePath = item.getName();
                if (!item.isFormField())
                {
					temporalFilePath = rootPath + com.genexus.PrivateUtilities.getTempFileName("tmp");
                }
                InputStream stream = item.openStream();
                FileItem fileItem = new FileItem(formFieldNameWithExtension, temporalFilePath, item.isFormField(), item.getFieldName(), stream);
                vector.add(fileItem);
            }
        }
        catch(Exception ex)
        {
        }
    }
  }

  public int getCount()
  {
    return vector.size();
  }
  
  public void clear()
  {
	  vector.clear();
  }

  public boolean hasitembyname( String name)
  {
    for (int i=0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy