Tabnine Logo
FileUploadBase.parseRequest
Code IndexAdd Tabnine to your IDE (free)

How to use
parseRequest
method
in
org.apache.tomcat.util.http.fileupload.FileUploadBase

Best Java code snippets using org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest (Showing top 3 results out of 315)

origin: codefollower/Tomcat-Research

/**
 * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
 * compliant <code>multipart/form-data</code> stream.
 *
 * @param ctx The context for the request to be parsed.
 *
 * @return A map of <code>FileItem</code> instances parsed from the request.
 *
 * @throws FileUploadException if there are problems reading/parsing
 *                             the request or storing files.
 *
 * @since 1.3
 */
public Map<String, List<FileItem>> parseParameterMap(RequestContext ctx)
    throws FileUploadException {
  final List<FileItem> items = parseRequest(ctx);
  final Map<String, List<FileItem>> itemsMap = new HashMap<>(items.size());
  for (FileItem fileItem : items) {
    String fieldName = fileItem.getFieldName();
    List<FileItem> mappedItems = itemsMap.get(fieldName);
    if (mappedItems == null) {
      mappedItems = new ArrayList<>();
      itemsMap.put(fieldName, mappedItems);
    }
    mappedItems.add(fileItem);
  }
  return itemsMap;
}
origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

/**
 * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
 * compliant <code>multipart/form-data</code> stream.
 *
 * @param ctx The context for the request to be parsed.
 *
 * @return A map of <code>FileItem</code> instances parsed from the request.
 *
 * @throws FileUploadException if there are problems reading/parsing
 *                             the request or storing files.
 *
 * @since 1.3
 */
public Map<String, List<FileItem>> parseParameterMap(RequestContext ctx)
    throws FileUploadException {
  final List<FileItem> items = parseRequest(ctx);
  final Map<String, List<FileItem>> itemsMap = new HashMap<>(items.size());
  for (FileItem fileItem : items) {
    String fieldName = fileItem.getFieldName();
    List<FileItem> mappedItems = itemsMap.get(fieldName);
    if (mappedItems == null) {
      mappedItems = new ArrayList<>();
      itemsMap.put(fieldName, mappedItems);
    }
    mappedItems.add(fileItem);
  }
  return itemsMap;
}
origin: org.apache.geronimo.ext.tomcat/util

/**
 * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
 * compliant <code>multipart/form-data</code> stream.
 *
 * @param ctx The context for the request to be parsed.
 *
 * @return A map of <code>FileItem</code> instances parsed from the request.
 *
 * @throws FileUploadException if there are problems reading/parsing
 *                             the request or storing files.
 *
 * @since 1.3
 */
public Map<String, List<FileItem>> parseParameterMap(RequestContext ctx)
    throws FileUploadException {
  final List<FileItem> items = parseRequest(ctx);
  final Map<String, List<FileItem>> itemsMap =
      new HashMap<String, List<FileItem>>(items.size());
  for (FileItem fileItem : items) {
    String fieldName = fileItem.getFieldName();
    List<FileItem> mappedItems = itemsMap.get(fieldName);
    if (mappedItems == null) {
      mappedItems = new ArrayList<FileItem>();
      itemsMap.put(fieldName, mappedItems);
    }
    mappedItems.add(fileItem);
  }
  return itemsMap;
}
org.apache.tomcat.util.http.fileuploadFileUploadBaseparseRequest

Javadoc

Processes an RFC 1867 compliant multipart/form-data stream. If files are stored on disk, the path is given by getRepository().

Popular methods of FileUploadBase

  • getFieldName
    Retrieves the field name from the Content-disposition header.
  • getFileItemFactory
    Returns the factory class used when creating file items.
  • getFileName
    Retrieves the file name from the Content-disposition header.
  • getBoundary
    Retrieves the boundary from the Content-type header.
  • getItemIterator
    Processes an RFC 1867 [http://www.ietf.org/rfc/rfc1867.txt] compliant multipart/form-data stream.
  • getParsedHeaders
    Parses the header-part and returns as key/value pairs. If there are multiple headers of the same
  • newFileItemHeaders
    Creates a new instance of FileItemHeaders.
  • parseEndOfLine
    Skips bytes until the end of the current line.
  • parseHeaderLine
    Reads the next header line.
  • isMultipartContent
    Utility method that determines whether the request contains multipart content. NOTE:This method wil
  • createItem
    Creates a new FileItem instance.
  • getHeader
    Returns the header with the specified name from the supplied map. The header lookup is case-insensit
  • createItem,
  • getHeader,
  • parseHeaders

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • getSystemService (Context)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • JCheckBox (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now