📄 outgoingfiletransfer.html
字号:
<DL><DD>This method handles the negotiation of the file transfer and the stream, it only returns the created stream after the negotiation has been completed.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>fileName</CODE> - The name of the file that will be transmitted. It is preferable for this name to have an extension as it will be used to determine the type of file it is.<DD><CODE>fileSize</CODE> - The size in bytes of the file that will be transmitted.<DD><CODE>description</CODE> - A description of the file that will be transmitted.<DT><B>Returns:</B><DD>The OutputStream that is connected to the peer to transmit the file.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></CODE> - Thrown if an error occurs during the file transfer negotiation process.</DL></DD></DL><HR><A NAME="sendFile(java.lang.String, long, java.lang.String, org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer.NegotiationProgress)"><!-- --></A><H3>sendFile</H3><PRE>public void <B>sendFile</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> fileName, long fileSize, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> description, <A HREF="../../../../org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.NegotiationProgress.html" title="interface in org.jivesoftware.smackx.filetransfer">OutgoingFileTransfer.NegotiationProgress</A> progress)</PRE><DL><DD>This methods handles the transfer and stream negotiation process. It returns immediately and its progress will be updated through the <A HREF="../../../../org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.NegotiationProgress.html" title="interface in org.jivesoftware.smackx.filetransfer"><CODE>OutgoingFileTransfer.NegotiationProgress</CODE></A> callback.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>fileName</CODE> - The name of the file that will be transmitted. It is preferable for this name to have an extension as it will be used to determine the type of file it is.<DD><CODE>fileSize</CODE> - The size in bytes of the file that will be transmitted.<DD><CODE>description</CODE> - A description of the file that will be transmitted.<DD><CODE>progress</CODE> - A callback to monitor the progress of the file transfer negotiation process and to retrieve the OutputStream when it is complete.</DL></DD></DL><HR><A NAME="sendFile(java.io.File, java.lang.String)"><!-- --></A><H3>sendFile</H3><PRE>public void <B>sendFile</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/File.html" title="class or interface in java.io">File</A> file, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> description) throws <A HREF="../../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></PRE><DL><DD>This method handles the stream negotiation process and transmits the file to the remote user. It returns immediatly and the progress of the file transfer can be monitored through several methods: <UL> <LI><A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.html#getStatus()"><CODE>FileTransfer.getStatus()</CODE></A> <LI><A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.html#getProgress()"><CODE>FileTransfer.getProgress()</CODE></A> <LI><A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.html#isDone()"><CODE>FileTransfer.isDone()</CODE></A> </UL><P><DD><DL><DT><B>Parameters:</B><DD><CODE>file</CODE> - the file to transfer to the remote entity.<DD><CODE>description</CODE> - a description for the file to transfer.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></CODE> - If there is an error during the negotiation process or the sending of the file.</DL></DD></DL><HR><A NAME="getBytesSent()"><!-- --></A><H3>getBytesSent</H3><PRE>public long <B>getBytesSent</B>()</PRE><DL><DD>Returns the amount of bytes that have been sent for the file transfer. Or -1 if the file transfer has not started. <p> Note: This method is only useful when the <A HREF="../../../../org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.html#sendFile(java.io.File, java.lang.String)"><CODE>sendFile(File, String)</CODE></A> method is called, as it is the only method that actualy transmits the file.<P><DD><DL><DT><B>Returns:</B><DD>Returns the amount of bytes that have been sent for the file transfer. Or -1 if the file transfer has not started.</DL></DD></DL><HR><A NAME="cancel()"><!-- --></A><H3>cancel</H3><PRE>public void <B>cancel</B>()</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.html#cancel()">FileTransfer</A></CODE></B></DD><DD>Cancels the file transfer.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.html#cancel()">cancel</A></CODE> in class <CODE><A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.html" title="class in org.jivesoftware.smackx.filetransfer">FileTransfer</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="updateStatus(org.jivesoftware.smackx.filetransfer.FileTransfer.Status, org.jivesoftware.smackx.filetransfer.FileTransfer.Status)"><!-- --></A><H3>updateStatus</H3><PRE>protected boolean <B>updateStatus</B>(<A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.Status.html" title="enum in org.jivesoftware.smackx.filetransfer">FileTransfer.Status</A> oldStatus, <A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.Status.html" title="enum in org.jivesoftware.smackx.filetransfer">FileTransfer.Status</A> newStatus)</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.html#updateStatus(org.jivesoftware.smackx.filetransfer.FileTransfer.Status, org.jivesoftware.smackx.filetransfer.FileTransfer.Status)">updateStatus</A></CODE> in class <CODE><A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.html" title="class in org.jivesoftware.smackx.filetransfer">FileTransfer</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setStatus(org.jivesoftware.smackx.filetransfer.FileTransfer.Status)"><!-- --></A><H3>setStatus</H3><PRE>protected void <B>setStatus</B>(<A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.Status.html" title="enum in org.jivesoftware.smackx.filetransfer">FileTransfer.Status</A> status)</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.html#setStatus(org.jivesoftware.smackx.filetransfer.FileTransfer.Status)">setStatus</A></CODE> in class <CODE><A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.html" title="class in org.jivesoftware.smackx.filetransfer">FileTransfer</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="setException(java.lang.Exception)"><!-- --></A><H3>setException</H3><PRE>protected void <B>setException</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Exception.html" title="class or interface in java.lang">Exception</A> exception)</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.html#setException(java.lang.Exception)">setException</A></CODE> in class <CODE><A HREF="../../../../org/jivesoftware/smackx/filetransfer/FileTransfer.html" title="class in org.jivesoftware.smackx.filetransfer">FileTransfer</A></CODE></DL></DD><DD><DL></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=2 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><b>Smack</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../org/jivesoftware/smackx/filetransfer/IncomingFileTransfer.html" title="class in org.jivesoftware.smackx.filetransfer"><B>PREV CLASS</B></A> <A HREF="../../../../org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.NegotiationProgress.html" title="interface in org.jivesoftware.smackx.filetransfer"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.html" target="_top"><B>FRAMES</B></A> <A HREF="OutgoingFileTransfer.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: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#fields_inherited_from_class_org.jivesoftware.smackx.filetransfer.FileTransfer">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: FIELD | <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><i>Copyright © 2003-2007 Jive Software. </i></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -