List of usage examples for org.apache.commons.fileupload DeferredFileOutputStream DeferredFileOutputStream
public DeferredFileOutputStream(int threshold, File outputFile)
From source file:com.w4t.engine.requests.UploadRequestFileItem.java
/** * <p>returns an {@link java.io.OutputStream OutputStream}that can be used for * storing the contents of the file.</p> * //from w w w . j a v a2s . co m * @return An {@link java.io.OutputStream OutputStream}that can be used for * storing the contensts of the file. * @exception IOException if an error occurs. */ public OutputStream getOutputStream() throws IOException { if (dfos == null) { File outputFile = getTempFile(); if (isFormField()) { dfos = new DeferredFileOutputStream(DEFAULT_OUTPUTSTREAM_SIZE, outputFile); } else { dfos = new DeferredFileOutputStream(sizeThreshold, outputFile); } } return dfos; }