Search in sources :

Example 1 with DeferredFileOutputStream

use of org.apache.tomcat.util.http.fileupload.DeferredFileOutputStream in project tomcat by apache.

the class DiskFileItem method getOutputStream.

/**
     * Returns an {@link java.io.OutputStream OutputStream} that can
     * be used for storing the contents of the file.
     *
     * @return An {@link java.io.OutputStream OutputStream} that can be used
     *         for storing the contents of the file.
     *
     * @throws IOException if an error occurs.
     */
@Override
public OutputStream getOutputStream() throws IOException {
    if (dfos == null) {
        File outputFile = getTempFile();
        dfos = new DeferredFileOutputStream(sizeThreshold, outputFile);
    }
    return dfos;
}
Also used : DeferredFileOutputStream(org.apache.tomcat.util.http.fileupload.DeferredFileOutputStream) File(java.io.File)

Aggregations

File (java.io.File)1 DeferredFileOutputStream (org.apache.tomcat.util.http.fileupload.DeferredFileOutputStream)1