<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_18) on Fri Dec 03 09:46:58 UTC 2010 --> <TITLE> DiskFileItem </TITLE> <META NAME="date" CONTENT="2010-12-03"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="DiskFileItem"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" 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_top_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="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DiskFileItem.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 CLASS <A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItemFactory.html" title="class in org.apache.commons.fileupload.disk"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/commons/fileupload/disk/DiskFileItem.html" target="_top"><B>FRAMES</B></A> <A HREF="DiskFileItem.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> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.apache.commons.fileupload.disk</FONT> <BR> Class DiskFileItem</H2> <PRE> java.lang.Object <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.fileupload.disk.DiskFileItem</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable, <A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A>, <A HREF="../../../../../org/apache/commons/fileupload/FileItemHeadersSupport.html" title="interface in org.apache.commons.fileupload">FileItemHeadersSupport</A></DD> </DL> <DL> <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../../../org/apache/commons/fileupload/DefaultFileItem.html" title="class in org.apache.commons.fileupload">DefaultFileItem</A></DD> </DL> <HR> <DL> <DT><PRE>public class <B>DiskFileItem</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A>, <A HREF="../../../../../org/apache/commons/fileupload/FileItemHeadersSupport.html" title="interface in org.apache.commons.fileupload">FileItemHeadersSupport</A></DL> </PRE> <P> <p> The default implementation of the <A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload"><CODE>FileItem</CODE></A> interface. <p> After retrieving an instance of this class from a <A HREF="../../../../../org/apache/commons/fileupload/DiskFileUpload.html" title="class in org.apache.commons.fileupload"><CODE>DiskFileUpload</CODE></A> instance (see <A HREF="../../../../../org/apache/commons/fileupload/DiskFileUpload.html" title="class in org.apache.commons.fileupload"><CODE>#parseRequest(javax.servlet.http.HttpServletRequest)</CODE></A>), you may either request all contents of file at once using <A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#get()"><CODE>get()</CODE></A> or request an <CODE>InputStream</CODE> with <A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getInputStream()"><CODE>getInputStream()</CODE></A> and process the file without attempting to load it into memory, which may come handy with large files. <p>When using the <code>DiskFileItemFactory</code>, then you should consider the following: Temporary files are automatically deleted as soon as they are no longer needed. (More precisely, when the corresponding instance of <CODE>File</CODE> is garbage collected.) This is done by the so-called reaper thread, which is started automatically when the class <CODE>FileCleaner</CODE> is loaded. It might make sense to terminate that thread, for example, if your web application ends. See the section on "Resource cleanup" in the users guide of commons-fileupload.</p> <P> <P> <DL> <DT><B>Since:</B></DT> <DD>FileUpload 1.1</DD> <DT><B>Version:</B></DT> <DD>$Id: DiskFileItem.java 607869 2008-01-01 16:42:17Z jochen $</DD> <DT><B>Author:</B></DT> <DD><a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>, <a href="mailto:sean@informage.net">Sean Legassick</a>, <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>, <a href="mailto:jmcnally@apache.org">John McNally</a>, <a href="mailto:martinc@apache.org">Martin Cooper</a>, Sean C. Sullivan</DD> <DT><B>See Also:</B><DD><A HREF="../../../../../serialized-form.html#org.apache.commons.fileupload.disk.DiskFileItem">Serialized Form</A></DL> <HR> <P> <!-- =========== FIELD SUMMARY =========== --> <A NAME="field_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Field Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private byte[]</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#cachedContent">cachedContent</A></B></CODE> <BR> Cached contents of the file.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#contentType">contentType</A></B></CODE> <BR> The content type passed by the browser, or <code>null</code> if not defined.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private static int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#counter">counter</A></B></CODE> <BR> Counter used in unique identifier generation.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#DEFAULT_CHARSET">DEFAULT_CHARSET</A></B></CODE> <BR> Default content charset to be used when no explicit charset parameter is provided by the sender.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private org.apache.commons.io.output.DeferredFileOutputStream</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#dfos">dfos</A></B></CODE> <BR> Output stream for this item.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private java.io.File</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#dfosFile">dfosFile</A></B></CODE> <BR> File to allow for serialization of the content of this item.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#fieldName">fieldName</A></B></CODE> <BR> The name of the form field as provided by the browser.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#fileName">fileName</A></B></CODE> <BR> The original filename in the user's filesystem.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private <A HREF="../../../../../org/apache/commons/fileupload/FileItemHeaders.html" title="interface in org.apache.commons.fileupload">FileItemHeaders</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#headers">headers</A></B></CODE> <BR> The file items headers.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#isFormField">isFormField</A></B></CODE> <BR> Whether or not this item is a simple form field.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private java.io.File</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#repository">repository</A></B></CODE> <BR> The directory in which uploaded files will be stored, if stored on disk.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private static long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#serialVersionUID">serialVersionUID</A></B></CODE> <BR> The UID to use when serializing this instance.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#size">size</A></B></CODE> <BR> The size of the item, in bytes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#sizeThreshold">sizeThreshold</A></B></CODE> <BR> The threshold above which uploads will be stored on disk.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private java.io.File</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#tempFile">tempFile</A></B></CODE> <BR> The temporary file to use.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private static java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#UID">UID</A></B></CODE> <BR> UID used in unique file name generation.</TD> </TR> </TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#DiskFileItem(java.lang.String, java.lang.String, boolean, java.lang.String, int, java.io.File)">DiskFileItem</A></B>(java.lang.String fieldName, java.lang.String contentType, boolean isFormField, java.lang.String fileName, int sizeThreshold, java.io.File repository)</CODE> <BR> Constructs a new <code>DiskFileItem</code> instance.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#delete()">delete</A></B>()</CODE> <BR> Deletes the underlying storage for a file item, including deleting any associated temporary disk file.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#finalize()">finalize</A></B>()</CODE> <BR> Removes the file contents from the temporary storage.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> byte[]</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#get()">get</A></B>()</CODE> <BR> Returns the contents of the file as an array of bytes.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getCharSet()">getCharSet</A></B>()</CODE> <BR> Returns the content charset passed by the agent or <code>null</code> if not defined.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getContentType()">getContentType</A></B>()</CODE> <BR> Returns the content type passed by the agent or <code>null</code> if not defined.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getFieldName()">getFieldName</A></B>()</CODE> <BR> Returns the name of the field in the multipart form corresponding to this file item.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> <A HREF="../../../../../org/apache/commons/fileupload/FileItemHeaders.html" title="interface in org.apache.commons.fileupload">FileItemHeaders</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getHeaders()">getHeaders</A></B>()</CODE> <BR> Returns the file item headers.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.io.InputStream</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getInputStream()">getInputStream</A></B>()</CODE> <BR> Returns an <CODE>InputStream</CODE> that can be used to retrieve the contents of the file.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getName()">getName</A></B>()</CODE> <BR> Returns the original filename in the client's filesystem.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.io.OutputStream</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getOutputStream()">getOutputStream</A></B>()</CODE> <BR> Returns an <CODE>OutputStream</CODE> that can be used for storing the contents of the file.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getSize()">getSize</A></B>()</CODE> <BR> Returns the size of the file.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.io.File</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getStoreLocation()">getStoreLocation</A></B>()</CODE> <BR> Returns the <CODE>File</CODE> object for the <code>FileItem</code>'s data's temporary location on the disk.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getString()">getString</A></B>()</CODE> <BR> Returns the contents of the file as a String, using the default character encoding.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getString(java.lang.String)">getString</A></B>(java.lang.String charset)</CODE> <BR> Returns the contents of the file as a String, using the specified encoding.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>protected java.io.File</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getTempFile()">getTempFile</A></B>()</CODE> <BR> Creates and returns a <CODE>File</CODE> representing a uniquely named temporary file in the configured repository path.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private static java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getUniqueId()">getUniqueId</A></B>()</CODE> <BR> Returns an identifier that is unique within the class loader used to load this class, but does not have random-like apearance.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#isFormField()">isFormField</A></B>()</CODE> <BR> Determines whether or not a <code>FileItem</code> instance represents a simple form field.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#isInMemory()">isInMemory</A></B>()</CODE> <BR> Provides a hint as to whether or not the file contents will be read from memory.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#readObject(java.io.ObjectInputStream)">readObject</A></B>(java.io.ObjectInputStream in)</CODE> <BR> Reads the state of this object during deserialization.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#setFieldName(java.lang.String)">setFieldName</A></B>(java.lang.String fieldName)</CODE> <BR> Sets the field name used to reference this file item.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#setFormField(boolean)">setFormField</A></B>(boolean state)</CODE> <BR> Specifies whether or not a <code>FileItem</code> instance represents a simple form field.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#setHeaders(org.apache.commons.fileupload.FileItemHeaders)">setHeaders</A></B>(<A HREF="../../../../../org/apache/commons/fileupload/FileItemHeaders.html" title="interface in org.apache.commons.fileupload">FileItemHeaders</A> pHeaders)</CODE> <BR> Sets the file item headers.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#toString()">toString</A></B>()</CODE> <BR> Returns a string representation of this object.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#write(java.io.File)">write</A></B>(java.io.File file)</CODE> <BR> A convenience method to write an uploaded item to disk.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>private void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#writeObject(java.io.ObjectOutputStream)">writeObject</A></B>(java.io.ObjectOutputStream out)</CODE> <BR> Writes the state of this object during serialization.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> <P> <!-- ============ FIELD DETAIL =========== --> <A NAME="field_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Field Detail</B></FONT></TH> </TR> </TABLE> <A NAME="serialVersionUID"><!-- --></A><H3> serialVersionUID</H3> <PRE> private static final long <B>serialVersionUID</B></PRE> <DL> <DD>The UID to use when serializing this instance. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.commons.fileupload.disk.DiskFileItem.serialVersionUID">Constant Field Values</A></DL> </DL> <HR> <A NAME="DEFAULT_CHARSET"><!-- --></A><H3> DEFAULT_CHARSET</H3> <PRE> public static final java.lang.String <B>DEFAULT_CHARSET</B></PRE> <DL> <DD>Default content charset to be used when no explicit charset parameter is provided by the sender. Media subtypes of the "text" type are defined to have a default charset value of "ISO-8859-1" when received via HTTP. <P> <DL> <DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.commons.fileupload.disk.DiskFileItem.DEFAULT_CHARSET">Constant Field Values</A></DL> </DL> <HR> <A NAME="UID"><!-- --></A><H3> UID</H3> <PRE> private static final java.lang.String <B>UID</B></PRE> <DL> <DD>UID used in unique file name generation. <P> <DL> </DL> </DL> <HR> <A NAME="counter"><!-- --></A><H3> counter</H3> <PRE> private static int <B>counter</B></PRE> <DL> <DD>Counter used in unique identifier generation. <P> <DL> </DL> </DL> <HR> <A NAME="fieldName"><!-- --></A><H3> fieldName</H3> <PRE> private java.lang.String <B>fieldName</B></PRE> <DL> <DD>The name of the form field as provided by the browser. <P> <DL> </DL> </DL> <HR> <A NAME="contentType"><!-- --></A><H3> contentType</H3> <PRE> private java.lang.String <B>contentType</B></PRE> <DL> <DD>The content type passed by the browser, or <code>null</code> if not defined. <P> <DL> </DL> </DL> <HR> <A NAME="isFormField"><!-- --></A><H3> isFormField</H3> <PRE> private boolean <B>isFormField</B></PRE> <DL> <DD>Whether or not this item is a simple form field. <P> <DL> </DL> </DL> <HR> <A NAME="fileName"><!-- --></A><H3> fileName</H3> <PRE> private java.lang.String <B>fileName</B></PRE> <DL> <DD>The original filename in the user's filesystem. <P> <DL> </DL> </DL> <HR> <A NAME="size"><!-- --></A><H3> size</H3> <PRE> private long <B>size</B></PRE> <DL> <DD>The size of the item, in bytes. This is used to cache the size when a file item is moved from its original location. <P> <DL> </DL> </DL> <HR> <A NAME="sizeThreshold"><!-- --></A><H3> sizeThreshold</H3> <PRE> private int <B>sizeThreshold</B></PRE> <DL> <DD>The threshold above which uploads will be stored on disk. <P> <DL> </DL> </DL> <HR> <A NAME="repository"><!-- --></A><H3> repository</H3> <PRE> private java.io.File <B>repository</B></PRE> <DL> <DD>The directory in which uploaded files will be stored, if stored on disk. <P> <DL> </DL> </DL> <HR> <A NAME="cachedContent"><!-- --></A><H3> cachedContent</H3> <PRE> private byte[] <B>cachedContent</B></PRE> <DL> <DD>Cached contents of the file. <P> <DL> </DL> </DL> <HR> <A NAME="dfos"><!-- --></A><H3> dfos</H3> <PRE> private transient org.apache.commons.io.output.DeferredFileOutputStream <B>dfos</B></PRE> <DL> <DD>Output stream for this item. <P> <DL> </DL> </DL> <HR> <A NAME="tempFile"><!-- --></A><H3> tempFile</H3> <PRE> private transient java.io.File <B>tempFile</B></PRE> <DL> <DD>The temporary file to use. <P> <DL> </DL> </DL> <HR> <A NAME="dfosFile"><!-- --></A><H3> dfosFile</H3> <PRE> private java.io.File <B>dfosFile</B></PRE> <DL> <DD>File to allow for serialization of the content of this item. <P> <DL> </DL> </DL> <HR> <A NAME="headers"><!-- --></A><H3> headers</H3> <PRE> private <A HREF="../../../../../org/apache/commons/fileupload/FileItemHeaders.html" title="interface in org.apache.commons.fileupload">FileItemHeaders</A> <B>headers</B></PRE> <DL> <DD>The file items headers. <P> <DL> </DL> </DL> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="DiskFileItem(java.lang.String, java.lang.String, boolean, java.lang.String, int, java.io.File)"><!-- --></A><H3> DiskFileItem</H3> <PRE> public <B>DiskFileItem</B>(java.lang.String fieldName, java.lang.String contentType, boolean isFormField, java.lang.String fileName, int sizeThreshold, java.io.File repository)</PRE> <DL> <DD>Constructs a new <code>DiskFileItem</code> instance. <P> <DL> <DT><B>Parameters:</B><DD><CODE>fieldName</CODE> - The name of the form field.<DD><CODE>contentType</CODE> - The content type passed by the browser or <code>null</code> if not specified.<DD><CODE>isFormField</CODE> - Whether or not this item is a plain form field, as opposed to a file upload.<DD><CODE>fileName</CODE> - The original filename in the user's filesystem, or <code>null</code> if not specified.<DD><CODE>sizeThreshold</CODE> - The threshold, in bytes, below which items will be retained in memory and above which they will be stored as a file.<DD><CODE>repository</CODE> - The data repository, which is the directory in which files will be created, should the item size exceed the threshold.</DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="getInputStream()"><!-- --></A><H3> getInputStream</H3> <PRE> public java.io.InputStream <B>getInputStream</B>() throws java.io.IOException</PRE> <DL> <DD>Returns an <CODE>InputStream</CODE> that can be used to retrieve the contents of the file. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#getInputStream()">getInputStream</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>An <CODE>InputStream</CODE> that can be used to retrieve the contents of the file. <DT><B>Throws:</B> <DD><CODE>java.io.IOException</CODE> - if an error occurs.</DL> </DD> </DL> <HR> <A NAME="getContentType()"><!-- --></A><H3> getContentType</H3> <PRE> public java.lang.String <B>getContentType</B>()</PRE> <DL> <DD>Returns the content type passed by the agent or <code>null</code> if not defined. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#getContentType()">getContentType</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>The content type passed by the agent or <code>null</code> if not defined.</DL> </DD> </DL> <HR> <A NAME="getCharSet()"><!-- --></A><H3> getCharSet</H3> <PRE> public java.lang.String <B>getCharSet</B>()</PRE> <DL> <DD>Returns the content charset passed by the agent or <code>null</code> if not defined. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>The content charset passed by the agent or <code>null</code> if not defined.</DL> </DD> </DL> <HR> <A NAME="getName()"><!-- --></A><H3> getName</H3> <PRE> public java.lang.String <B>getName</B>()</PRE> <DL> <DD>Returns the original filename in the client's filesystem. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#getName()">getName</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>The original filename in the client's filesystem.</DL> </DD> </DL> <HR> <A NAME="isInMemory()"><!-- --></A><H3> isInMemory</H3> <PRE> public boolean <B>isInMemory</B>()</PRE> <DL> <DD>Provides a hint as to whether or not the file contents will be read from memory. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#isInMemory()">isInMemory</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD><code>true</code> if the file contents will be read from memory; <code>false</code> otherwise.</DL> </DD> </DL> <HR> <A NAME="getSize()"><!-- --></A><H3> getSize</H3> <PRE> public long <B>getSize</B>()</PRE> <DL> <DD>Returns the size of the file. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#getSize()">getSize</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>The size of the file, in bytes.</DL> </DD> </DL> <HR> <A NAME="get()"><!-- --></A><H3> get</H3> <PRE> public byte[] <B>get</B>()</PRE> <DL> <DD>Returns the contents of the file as an array of bytes. If the contents of the file were not yet cached in memory, they will be loaded from the disk storage and cached. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#get()">get</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>The contents of the file as an array of bytes.</DL> </DD> </DL> <HR> <A NAME="getString(java.lang.String)"><!-- --></A><H3> getString</H3> <PRE> public java.lang.String <B>getString</B>(java.lang.String charset) throws java.io.UnsupportedEncodingException</PRE> <DL> <DD>Returns the contents of the file as a String, using the specified encoding. This method uses <A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#get()"><CODE>get()</CODE></A> to retrieve the contents of the file. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#getString(java.lang.String)">getString</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>charset</CODE> - The charset to use. <DT><B>Returns:</B><DD>The contents of the file, as a string. <DT><B>Throws:</B> <DD><CODE>java.io.UnsupportedEncodingException</CODE> - if the requested character encoding is not available.</DL> </DD> </DL> <HR> <A NAME="getString()"><!-- --></A><H3> getString</H3> <PRE> public java.lang.String <B>getString</B>()</PRE> <DL> <DD>Returns the contents of the file as a String, using the default character encoding. This method uses <A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#get()"><CODE>get()</CODE></A> to retrieve the contents of the file. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#getString()">getString</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>The contents of the file, as a string.</DL> </DD> </DL> <HR> <A NAME="write(java.io.File)"><!-- --></A><H3> write</H3> <PRE> public void <B>write</B>(java.io.File file) throws java.lang.Exception</PRE> <DL> <DD>A convenience method to write an uploaded item to disk. The client code is not concerned with whether or not the item is stored in memory, or on disk in a temporary location. They just want to write the uploaded item to a file. <p> This implementation first attempts to rename the uploaded item to the specified destination file, if the item was originally written to disk. Otherwise, the data will be copied to the specified file. <p> This method is only guaranteed to work <em>once</em>, the first time it is invoked for a particular item. This is because, in the event that the method renames a temporary file, that file will no longer be available to copy or rename again at a later time. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#write(java.io.File)">write</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>file</CODE> - The <code>File</code> into which the uploaded item should be stored. <DT><B>Throws:</B> <DD><CODE>java.lang.Exception</CODE> - if an error occurs.</DL> </DD> </DL> <HR> <A NAME="delete()"><!-- --></A><H3> delete</H3> <PRE> public void <B>delete</B>()</PRE> <DL> <DD>Deletes the underlying storage for a file item, including deleting any associated temporary disk file. Although this storage will be deleted automatically when the <code>FileItem</code> instance is garbage collected, this method can be used to ensure that this is done at an earlier time, thus preserving system resources. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#delete()">delete</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getFieldName()"><!-- --></A><H3> getFieldName</H3> <PRE> public java.lang.String <B>getFieldName</B>()</PRE> <DL> <DD>Returns the name of the field in the multipart form corresponding to this file item. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#getFieldName()">getFieldName</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>The name of the form field.<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#setFieldName(java.lang.String)"><CODE>setFieldName(java.lang.String)</CODE></A></DL> </DD> </DL> <HR> <A NAME="setFieldName(java.lang.String)"><!-- --></A><H3> setFieldName</H3> <PRE> public void <B>setFieldName</B>(java.lang.String fieldName)</PRE> <DL> <DD>Sets the field name used to reference this file item. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#setFieldName(java.lang.String)">setFieldName</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>fieldName</CODE> - The name of the form field.<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#getFieldName()"><CODE>getFieldName()</CODE></A></DL> </DD> </DL> <HR> <A NAME="isFormField()"><!-- --></A><H3> isFormField</H3> <PRE> public boolean <B>isFormField</B>()</PRE> <DL> <DD>Determines whether or not a <code>FileItem</code> instance represents a simple form field. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#isFormField()">isFormField</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD><code>true</code> if the instance represents a simple form field; <code>false</code> if it represents an uploaded file.<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#setFormField(boolean)"><CODE>setFormField(boolean)</CODE></A></DL> </DD> </DL> <HR> <A NAME="setFormField(boolean)"><!-- --></A><H3> setFormField</H3> <PRE> public void <B>setFormField</B>(boolean state)</PRE> <DL> <DD>Specifies whether or not a <code>FileItem</code> instance represents a simple form field. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#setFormField(boolean)">setFormField</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>state</CODE> - <code>true</code> if the instance represents a simple form field; <code>false</code> if it represents an uploaded file.<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#isFormField()"><CODE>isFormField()</CODE></A></DL> </DD> </DL> <HR> <A NAME="getOutputStream()"><!-- --></A><H3> getOutputStream</H3> <PRE> public java.io.OutputStream <B>getOutputStream</B>() throws java.io.IOException</PRE> <DL> <DD>Returns an <CODE>OutputStream</CODE> that can be used for storing the contents of the file. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html#getOutputStream()">getOutputStream</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItem.html" title="interface in org.apache.commons.fileupload">FileItem</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>An <CODE>OutputStream</CODE> that can be used for storing the contensts of the file. <DT><B>Throws:</B> <DD><CODE>java.io.IOException</CODE> - if an error occurs.</DL> </DD> </DL> <HR> <A NAME="getStoreLocation()"><!-- --></A><H3> getStoreLocation</H3> <PRE> public java.io.File <B>getStoreLocation</B>()</PRE> <DL> <DD>Returns the <CODE>File</CODE> object for the <code>FileItem</code>'s data's temporary location on the disk. Note that for <code>FileItem</code>s that have their data stored in memory, this method will return <code>null</code>. When handling large files, you can use <CODE>File.renameTo(java.io.File)</CODE> to move the file to new location without copying the data, if the source and destination locations reside within the same logical volume. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>The data file, or <code>null</code> if the data is stored in memory.</DL> </DD> </DL> <HR> <A NAME="finalize()"><!-- --></A><H3> finalize</H3> <PRE> protected void <B>finalize</B>()</PRE> <DL> <DD>Removes the file contents from the temporary storage. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE>finalize</CODE> in class <CODE>java.lang.Object</CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="getTempFile()"><!-- --></A><H3> getTempFile</H3> <PRE> protected java.io.File <B>getTempFile</B>()</PRE> <DL> <DD>Creates and returns a <CODE>File</CODE> representing a uniquely named temporary file in the configured repository path. The lifetime of the file is tied to the lifetime of the <code>FileItem</code> instance; the file will be deleted when the instance is garbage collected. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>The <CODE>File</CODE> to be used for temporary storage.</DL> </DD> </DL> <HR> <A NAME="getUniqueId()"><!-- --></A><H3> getUniqueId</H3> <PRE> private static java.lang.String <B>getUniqueId</B>()</PRE> <DL> <DD>Returns an identifier that is unique within the class loader used to load this class, but does not have random-like apearance. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>A String with the non-random looking instance identifier.</DL> </DD> </DL> <HR> <A NAME="toString()"><!-- --></A><H3> toString</H3> <PRE> public java.lang.String <B>toString</B>()</PRE> <DL> <DD>Returns a string representation of this object. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>a string representation of this object.</DL> </DD> </DL> <HR> <A NAME="writeObject(java.io.ObjectOutputStream)"><!-- --></A><H3> writeObject</H3> <PRE> private void <B>writeObject</B>(java.io.ObjectOutputStream out) throws java.io.IOException</PRE> <DL> <DD>Writes the state of this object during serialization. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>out</CODE> - The stream to which the state should be written. <DT><B>Throws:</B> <DD><CODE>java.io.IOException</CODE> - if an error occurs.</DL> </DD> </DL> <HR> <A NAME="readObject(java.io.ObjectInputStream)"><!-- --></A><H3> readObject</H3> <PRE> private void <B>readObject</B>(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException</PRE> <DL> <DD>Reads the state of this object during deserialization. <P> <DD><DL> </DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>in</CODE> - The stream from which the state should be read. <DT><B>Throws:</B> <DD><CODE>java.io.IOException</CODE> - if an error occurs. <DD><CODE>java.lang.ClassNotFoundException</CODE> - if class cannot be found.</DL> </DD> </DL> <HR> <A NAME="getHeaders()"><!-- --></A><H3> getHeaders</H3> <PRE> public <A HREF="../../../../../org/apache/commons/fileupload/FileItemHeaders.html" title="interface in org.apache.commons.fileupload">FileItemHeaders</A> <B>getHeaders</B>()</PRE> <DL> <DD>Returns the file item headers. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItemHeadersSupport.html#getHeaders()">getHeaders</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItemHeadersSupport.html" title="interface in org.apache.commons.fileupload">FileItemHeadersSupport</A></CODE></DL> </DD> <DD><DL> <DT><B>Returns:</B><DD>The file items headers.</DL> </DD> </DL> <HR> <A NAME="setHeaders(org.apache.commons.fileupload.FileItemHeaders)"><!-- --></A><H3> setHeaders</H3> <PRE> public void <B>setHeaders</B>(<A HREF="../../../../../org/apache/commons/fileupload/FileItemHeaders.html" title="interface in org.apache.commons.fileupload">FileItemHeaders</A> pHeaders)</PRE> <DL> <DD>Sets the file item headers. <P> <DD><DL> <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItemHeadersSupport.html#setHeaders(org.apache.commons.fileupload.FileItemHeaders)">setHeaders</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/fileupload/FileItemHeadersSupport.html" title="interface in org.apache.commons.fileupload">FileItemHeadersSupport</A></CODE></DL> </DD> <DD><DL> <DT><B>Parameters:</B><DD><CODE>pHeaders</CODE> - The file items headers.</DL> </DD> </DL> <!-- ========= END OF CLASS DATA ========= --> <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="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/DiskFileItem.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 CLASS <A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItemFactory.html" title="class in org.apache.commons.fileupload.disk"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/commons/fileupload/disk/DiskFileItem.html" target="_top"><B>FRAMES</B></A> <A HREF="DiskFileItem.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> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>