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

📄 fileitem.html

📁 turbine教程
💻 HTML
📖 第 1 页 / 共 2 页
字号:
 not defined.</DL><HR><A NAME="content"><!-- --></A><H3>content</H3><PRE>protected byte[] <B>content</B></PRE><DL><DD>Cached contents of the file.</DL><HR><A NAME="storeLocation"><!-- --></A><H3>storeLocation</H3><PRE>protected java.io.File <B>storeLocation</B></PRE><DL><DD>Temporary storage location.</DL><HR><A NAME="byteStream"><!-- --></A><H3>byteStream</H3><PRE>protected java.io.ByteArrayOutputStream <B>byteStream</B></PRE><DL><DD>Temporary storage for in-memory files.</DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="FileItem(java.lang.String, java.lang.String)"><!-- --></A><H3>FileItem</H3><PRE>protected <B>FileItem</B>(java.lang.String&nbsp;fileName,                   java.lang.String&nbsp;contentType)</PRE><DL><DD>Constructs a new <code>FileItem</code>. <p>Use <A HREF="../../../../../org/apache/turbine/util/upload/FileItem.html#newInstance(java.lang.String, java.lang.String, java.lang.String, int)"><CODE>newInstance(String,String,String,int)</CODE></A> to instantiate <code>FileItems</code>.<DD><DL><DT><B>Parameters:</B><DD><CODE>fileName</CODE> - The original filename in the user's filesystem.<DD><CODE>contentType</CODE> - The content type passed by the browser or <code>null</code> if not defined.</DL></DD></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getName()"><!-- --></A><H3>getName</H3><PRE>public java.lang.String <B>getName</B>()</PRE><DL><DD>Returns the original filename in the user's filesystem. (implements DataSource method)<DD><DL><DT><B>Specified by: </B><DD><CODE>getName</CODE> in interface <CODE>javax.activation.DataSource</CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>The original filename in the user's filesystem.</DL></DD></DL><HR><A NAME="getFileName()"><!-- --></A><H3>getFileName</H3><PRE>public java.lang.String <B>getFileName</B>()</PRE><DL><DD>Returns the original filename in the user's filesystem.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The original filename in the user's filesystem.</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. (implements DataSource method).<DD><DL><DT><B>Specified by: </B><DD><CODE>getContentType</CODE> in interface <CODE>javax.activation.DataSource</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="inMemory()"><!-- --></A><H3>inMemory</H3><PRE>public boolean <B>inMemory</B>()</PRE><DL><DD>Provides a hint if the file contents will be read from memory.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD><code>True</code> if the file contents will be read from memory.</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.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The size of the file.</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 int the memory, they will be loaded from the disk storage and chached.<DD><DL></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()"><!-- --></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 default encoding.  This method uses <A HREF="../../../../../org/apache/turbine/util/upload/FileItem.html#get()"><CODE>get()</CODE></A> to retrieve the contents of the file.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>The contents of the file.</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;encoding)                           throws java.io.UnsupportedEncodingException</PRE><DL><DD>Returns the contents of the file as a String, using specified encoding.  This method uses <A HREF="../../../../../org/apache/turbine/util/upload/FileItem.html#get()"><CODE>get()</CODE></A> to retireve the contents of the file.<br><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>encoding</CODE> - The encoding to use.<DT><B>Returns:</B><DD>The contents of the file.<DT><B>Throws:</B><DD><CODE>UnsupportedEncodingException.</CODE> - &nbsp;</DL></DD></DL><HR><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. (implements DataSource method)<DD><DL><DT><B>Specified by: </B><DD><CODE>getInputStream</CODE> in interface <CODE>javax.activation.DataSource</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>Exception,</CODE> - a generic exception.</DL></DD></DL><HR><A NAME="getStream()"><!-- --></A><H3>getStream</H3><PRE>public java.io.InputStream <B>getStream</B>()                              throws java.io.IOException</PRE><DL><DD>Returns an <CODE>InputStream</CODE> that can be used to retrieve the contents of the file.<DD><DL></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>Exception,</CODE> - a generic exception.</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> objects for the FileItems's data temporary location on the disk.  Note that for <code>FileItems</code> that have their data stored in memory this method will return <code>null</code>.  When handling large files, you can use <CODE>File.renameTo(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.<DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>A File.</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.<DD><DL><DT><B>Overrides:</B><DD><CODE>finalize</CODE> in class <CODE>java.lang.Object</CODE></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. (implements DataSource method)<DD><DL><DT><B>Specified by: </B><DD><CODE>getOutputStream</CODE> in interface <CODE>javax.activation.DataSource</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>IOException.</CODE> - &nbsp;</DL></DD></DL><HR><A NAME="newInstance(java.lang.String, java.lang.String, java.lang.String, int)"><!-- --></A><H3>newInstance</H3><PRE>public static <A HREF="../../../../../org/apache/turbine/util/upload/FileItem.html">FileItem</A> <B>newInstance</B>(java.lang.String&nbsp;path,                                   java.lang.String&nbsp;name,                                   java.lang.String&nbsp;contentType,                                   int&nbsp;requestSize)</PRE><DL><DD>Instantiates a FileItem.  It uses <code>requestSize</code> to decide what temporary storage approach the new item should take.  The largest request that will have its items cached in memory can be configured in <code>TurbineResources.properties</code> in the entry named <code>file.upload.size.threshold</code><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>path</CODE> - A String.<DD><CODE>name</CODE> - The original filename in the user's filesystem.<DD><CODE>contentType</CODE> - The content type passed by the browser or <code>null</code> if not defined.<DD><CODE>requestSize</CODE> - The total size of the POST request this item belongs to.<DT><B>Returns:</B><DD>A FileItem.</DL></DD></DL><HR><A NAME="write(java.lang.String)"><!-- --></A><H3>write</H3><PRE>public void <B>write</B>(java.lang.String&nbsp;file)           throws java.lang.Exception</PRE><DL><DD>A convenience method to write an uploaded file to disk. The client code is not concerned whether or not the file is stored in memory, or on disk in a temporary location. They just want to write the uploaded file to disk.<DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>String</CODE> - full path to location where uploaded               should be stored.</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/FileItem.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../../../../org/apache/turbine/util/upload/FileHandler.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../../../../org/apache/turbine/util/upload/MultipartStream.html"><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>  &nbsp;&nbsp;<A HREF="FileItem.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR>Copyright &copy; 2000-2002 Apache Software Foundation. All Rights Reserved.</BODY></HTML>

⌨️ 快捷键说明

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