?? package-summary.html
字號:
<TD>This exception is thrown, if an attempt is made to read data from the <CODE>InputStream</CODE>, which has been returned by <A HREF="../../../../org/apache/commons/fileupload/FileItemStream.html#openStream()"><CODE>FileItemStream.openStream()</CODE></A>, after <CODE>Iterator.hasNext()</CODE> has been invoked on the iterator, which created the <A HREF="../../../../org/apache/commons/fileupload/FileItemStream.html" title="interface in org.apache.commons.fileupload"><CODE>FileItemStream</CODE></A>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../../org/apache/commons/fileupload/FileUploadBase.FileSizeLimitExceededException.html" title="class in org.apache.commons.fileupload">FileUploadBase.FileSizeLimitExceededException</A></B></TD><TD>Thrown to indicate that A files size exceeds the configured maximum.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../../org/apache/commons/fileupload/FileUploadBase.FileUploadIOException.html" title="class in org.apache.commons.fileupload">FileUploadBase.FileUploadIOException</A></B></TD><TD>This exception is thrown for hiding an inner <A HREF="../../../../org/apache/commons/fileupload/FileUploadException.html" title="class in org.apache.commons.fileupload"><CODE>FileUploadException</CODE></A> in an <CODE>IOException</CODE>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../../org/apache/commons/fileupload/FileUploadBase.InvalidContentTypeException.html" title="class in org.apache.commons.fileupload">FileUploadBase.InvalidContentTypeException</A></B></TD><TD>Thrown to indicate that the request is not a multipart request.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../../org/apache/commons/fileupload/FileUploadBase.IOFileUploadException.html" title="class in org.apache.commons.fileupload">FileUploadBase.IOFileUploadException</A></B></TD><TD>Thrown to indicate an IOException.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../../org/apache/commons/fileupload/FileUploadBase.SizeException.html" title="class in org.apache.commons.fileupload">FileUploadBase.SizeException</A></B></TD><TD>This exception is thrown, if a requests permitted size is exceeded.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../../org/apache/commons/fileupload/FileUploadBase.SizeLimitExceededException.html" title="class in org.apache.commons.fileupload">FileUploadBase.SizeLimitExceededException</A></B></TD><TD>Thrown to indicate that the request size exceeds the configured maximum.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../../org/apache/commons/fileupload/FileUploadBase.UnknownSizeException.html" title="class in org.apache.commons.fileupload">FileUploadBase.UnknownSizeException</A></B></TD><TD><B>Deprecated.</B> <I>As of commons-fileupload 1.2, the presence of a content-length header is no longer required.</I></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../../org/apache/commons/fileupload/FileUploadException.html" title="class in org.apache.commons.fileupload">FileUploadException</A></B></TD><TD>Exception for errors encountered while processing the request.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.IllegalBoundaryException.html" title="class in org.apache.commons.fileupload">MultipartStream.IllegalBoundaryException</A></B></TD><TD>Thrown upon attempt of setting an invalid boundary token.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD WIDTH="15%"><B><A HREF="../../../../org/apache/commons/fileupload/MultipartStream.MalformedStreamException.html" title="class in org.apache.commons.fileupload">MultipartStream.MalformedStreamException</A></B></TD><TD>Thrown to indicate that the input stream fails to follow the required syntax.</TD></TR></TABLE> <P><A NAME="package_description"><!-- --></A><H2>Package org.apache.commons.fileupload Description</H2><P><p> A component for handling HTML file uploads as specified by <a href="http://www.ietf.org/rfc/rfc1867.txt" target="_top">RFC 1867</a>. This component provides support for uploads within both servlets (JSR 53) and portlets (JSR 168). </p> <p> While this package provides the generic functionality for file uploads, these classes are not typically used directly. Instead, normal usage involves one of the provided extensions of <A HREF="../../../../org/apache/commons/fileupload/FileUpload.html" title="class in org.apache.commons.fileupload"><CODE>FileUpload</CODE></A> such as <A HREF="../../../../org/apache/commons/fileupload/servlet/ServletFileUpload.html" title="class in org.apache.commons.fileupload.servlet"><CODE>ServletFileUpload</CODE></A> or <A HREF="../../../../org/apache/commons/fileupload/portlet/PortletFileUpload.html" title="class in org.apache.commons.fileupload.portlet"><CODE>PortletFileUpload</CODE></A>, together with a factory for <A HREF="../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload"><CODE>FileItem</CODE></A> instances, such as <A HREF="../../../../org/apache/commons/fileupload/disk/DiskFileItemFactory.html" title="class in org.apache.commons.fileupload.disk"><CODE>DiskFileItemFactory</CODE></A>. </p> <p> The following is a brief example of typical usage in a servlet, storing the uploaded files on disk. </p><pre> public void doPost(HttpServletRequest req, HttpServletResponse res) { DiskFileItemFactory factory = new DiskFileItemFactory(); // maximum size that will be stored in memory factory.setSizeThreshold(4096); // the location for saving data that is larger than getSizeThreshold() factory.setRepository(new File("/tmp")); ServletFileUpload upload = new ServletFileUpload(factory); // maximum size before a FileUploadException will be thrown upload.setSizeMax(1000000); List fileItems = upload.parseRequest(req); // assume we know there are two files. The first file is a small // text file, the second is unknown and is written to a file on // the server Iterator i = fileItems.iterator(); String comment = ((FileItem)i.next()).getString(); FileItem fi = (FileItem)i.next(); // filename on the client String fileName = fi.getName(); // save comment and filename to database ... // write the file fi.write(new File("/www/uploads/", fileName)); }</pre> <p> In the example above, the first file is loaded into memory as a <code>String</code>. Before calling the <code>getString</code> method, the data may have been in memory or on disk depending on its size. The second file we assume it will be large and therefore never explicitly load it into memory, though if it is less than 4096 bytes it will be in memory before it is written to its final location. When writing to the final location, if the data is larger than the threshold, an attempt is made to rename the temporary file to the given location. If it cannot be renamed, it is streamed to the new location. </p> <p> Please see the FileUpload <a href="http://commons.apache.org/fileupload/using.html" target="_top">User Guide</a> for further details and examples of how to use this package. </p><P><P><DL></DL><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV PACKAGE <A HREF="../../../../org/apache/commons/fileupload/disk/package-summary.html"><B>NEXT PACKAGE</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/apache/commons/fileupload/package-summary.html" target="_top"><B>FRAMES</B></A> <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright ? 2002-2008 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -