⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 diskfileitem.html

📁 最好的java上传组件
💻 HTML
📖 第 1 页 / 共 3 页
字号:
 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>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#isFormField()">isFormField</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#isInMemory()">isInMemory</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;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&nbsp;fieldName)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#setFormField(boolean)">setFormField</A></B>(boolean&nbsp;state)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../../../org/apache/commons/fileupload/disk/DiskFileItem.html#toString()">toString</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;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&nbsp;file)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A convenience method to write an uploaded item to disk.</TD></TR></TABLE>&nbsp;<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"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></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"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></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&nbsp;fieldName,                    java.lang.String&nbsp;contentType,                    boolean&nbsp;isFormField,                    java.lang.String&nbsp;fileName,                    int&nbsp;sizeThreshold,                    java.io.File&nbsp;repository)</PRE><DL><DD>Constructs a new <code>DiskFileItem</code> instance.<P><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><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></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&nbsp;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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -