?? diskfileitem.html
字號:
<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> 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> 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></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="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><!-- ========= 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>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -