📄 cfufileitem.html
字号:
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="../../../javazoom/upload/parsing/CfuFileItem.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="../../../javazoom/upload/parsing/CfuFileItem.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="../../../javazoom/upload/parsing/CfuFileItem.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="../../../javazoom/upload/parsing/CfuFileItem.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="../../../javazoom/upload/parsing/CfuFileItem.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">
<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, toString, 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">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="FILE_PREFIX"><!-- --></A><H3>
FILE_PREFIX</H3>
<PRE>
public static java.lang.String <B>FILE_PREFIX</B></PRE>
<DL>
<DD>Temporary file prefix : Default is upload_
<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">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="CfuFileItem(java.lang.String, java.lang.String, boolean, java.lang.String, int, java.io.File, java.util.Vector, int)"><!-- --></A><H3>
CfuFileItem</H3>
<PRE>
public <B>CfuFileItem</B>(java.lang.String fieldName, java.lang.String contentType, boolean isFormField, java.lang.String fileName, int sizeThreshold, java.io.File repository, java.util.Vector listeners, int custom)</PRE>
<DL>
<DD>Constructs a new <code>CfuFileItem</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.<DD><CODE>listeners</CODE> - UploadBean listeners to be notified.<DD><CODE>custom</CODE> - Content Length of HTTP post.</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>getInputStream</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</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 browser or <code>null</code> if not defined.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>getContentType</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The content type passed by the browser 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>getName</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</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>isInMemory</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</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>getSize</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</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>get</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</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 encoding) 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="../../../javazoom/upload/parsing/CfuFileItem.html#get()"><CODE>get()</CODE></A> to retrieve the contents of the file.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>getString</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>encoding</CODE> - The character encoding 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="../../../javazoom/upload/parsing/CfuFileItem.html#get()"><CODE>get()</CODE></A> to retrieve the contents of the file.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>getString</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</CODE></DL>
</DD>
<DD><DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -