org.apache.tomcat.util.http.fileupload.FileUploadException Java Examples

The following examples show how to use org.apache.tomcat.util.http.fileupload.FileUploadException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MultipartToBase64ConverterServletRequest.java    From AuTe-Framework with Apache License 2.0 5 votes vote down vote up
private List<FileItem> settingsLoadAndParseRequest() throws FileUploadException {
    DiskFileItemFactory factory = new DiskFileItemFactory();
    // files larger than Threshold will be saved to tmpDir on disk
    factory.setSizeThreshold(configProperties.getThresholdTmpFileSize());
    factory.setRepository(tmpDir);

    ServletFileUpload upload = new ServletFileUpload(factory);
    upload.setSizeMax(configProperties.getThresholdFilesSize());
    ServletRequestContext uploadContext = new ServletRequestContext(this);
    return upload.parseRequest(uploadContext);
}
 
Example #2
Source File: ServletFileUpload.java    From Tomcat8-Source-Read with MIT License 2 votes vote down vote up
/**
 * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
 * compliant <code>multipart/form-data</code> stream.
 *
 * @param request The servlet 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(HttpServletRequest request)
        throws FileUploadException {
    return parseParameterMap(new ServletRequestContext(request));
}
 
Example #3
Source File: ServletFileUpload.java    From Tomcat8-Source-Read with MIT License 2 votes vote down vote up
/**
 * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
 * compliant <code>multipart/form-data</code> stream.
 *
 * @param request The servlet request to be parsed.
 *
 * @return An iterator to instances of <code>FileItemStream</code>
 *         parsed from the request, in the order that they were
 *         transmitted.
 *
 * @throws FileUploadException if there are problems reading/parsing
 *                             the request or storing files.
 * @throws IOException An I/O error occurred. This may be a network
 *   error while communicating with the client or a problem while
 *   storing the uploaded content.
 */
public FileItemIterator getItemIterator(HttpServletRequest request)
throws FileUploadException, IOException {
    return super.getItemIterator(new ServletRequestContext(request));
}
 
Example #4
Source File: BlobUploadConfigurator.java    From aceql-http with GNU Lesser General Public License v2.1 2 votes vote down vote up
/**
 * Method that will do the effective upload.
 * 
 * @param request
 *            the http servlet request
 * @param response
 *            the http servlet response to use to write the out stream on.
 *            The underlying output stream must *not* be closed at end of
 *            download, because it can be reused to send error message to
 *            client side after this method execution.
 * @param blobDirectory
 *            the directory into which the blob must be uploaded
 * 
 * @throws IOException
 *             if any I/O exception occurs during the upload
 * @throws FileUploadException
 *             if any exception during upload
 */
void upload(HttpServletRequest request, HttpServletResponse response,
 File blobDirectory) throws IOException, FileUploadException;
 
Example #5
Source File: ServletFileUpload.java    From Tomcat7.0.67 with Apache License 2.0 2 votes vote down vote up
/**
 * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
 * compliant <code>multipart/form-data</code> stream.
 *
 * @param request The servlet 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(HttpServletRequest request)
        throws FileUploadException {
    return parseParameterMap(new ServletRequestContext(request));
}
 
Example #6
Source File: ServletFileUpload.java    From Tomcat7.0.67 with Apache License 2.0 2 votes vote down vote up
/**
 * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
 * compliant <code>multipart/form-data</code> stream.
 *
 * @param request The servlet request to be parsed.
 *
 * @return An iterator to instances of <code>FileItemStream</code>
 *         parsed from the request, in the order that they were
 *         transmitted.
 *
 * @throws FileUploadException if there are problems reading/parsing
 *                             the request or storing files.
 * @throws IOException An I/O error occurred. This may be a network
 *   error while communicating with the client or a problem while
 *   storing the uploaded content.
 */
public FileItemIterator getItemIterator(HttpServletRequest request)
throws FileUploadException, IOException {
    return super.getItemIterator(new ServletRequestContext(request));
}
 
Example #7
Source File: ServletFileUpload.java    From tomcatsrc with Apache License 2.0 2 votes vote down vote up
/**
 * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
 * compliant <code>multipart/form-data</code> stream.
 *
 * @param request The servlet 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(HttpServletRequest request)
        throws FileUploadException {
    return parseParameterMap(new ServletRequestContext(request));
}
 
Example #8
Source File: ServletFileUpload.java    From tomcatsrc with Apache License 2.0 2 votes vote down vote up
/**
 * Processes an <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC 1867</a>
 * compliant <code>multipart/form-data</code> stream.
 *
 * @param request The servlet request to be parsed.
 *
 * @return An iterator to instances of <code>FileItemStream</code>
 *         parsed from the request, in the order that they were
 *         transmitted.
 *
 * @throws FileUploadException if there are problems reading/parsing
 *                             the request or storing files.
 * @throws IOException An I/O error occurred. This may be a network
 *   error while communicating with the client or a problem while
 *   storing the uploaded content.
 */
public FileItemIterator getItemIterator(HttpServletRequest request)
throws FileUploadException, IOException {
    return super.getItemIterator(new ServletRequestContext(request));
}