📄 cfufileitem.html
字号:
<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>write</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</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>delete</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</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>getFieldName</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>The name of the form field.<DT><B>See Also:</B><DD><A HREF="../../../javazoom/upload/parsing/CfuFileItem.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>setFieldName</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</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="../../../javazoom/upload/parsing/CfuFileItem.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>isFormField</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</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="../../../javazoom/upload/parsing/CfuFileItem.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>setFormField</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</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="../../../javazoom/upload/parsing/CfuFileItem.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>getOutputStream</CODE> in interface <CODE>org.apache.commons.fileupload.FileItem</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>
</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.
<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>
<!-- ========= 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=3 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="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="../../../javazoom/upload/parsing/CfuFileItemFactory.html" title="class in javazoom.upload.parsing"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="CfuFileItem.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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -