From c96be693dc06a42296c806a1c16c35588ca56049 Mon Sep 17 00:00:00 2001 From: rcollier Date: Wed, 21 Sep 2011 23:57:34 +0000 Subject: [PATCH 01/13] Moved utility class to the core, since it is not extension related and useful for all code. git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_2_0@12598 b35dd754-fafc-0310-a699-88a17e54d16e --- .../{smackx/packet => smack/util}/SyncPacketSend.java | 2 +- .../smackx/bytestreams/ibb/InBandBytestreamManager.java | 2 +- .../smackx/bytestreams/ibb/InBandBytestreamSession.java | 2 +- .../smackx/bytestreams/socks5/Socks5BytestreamManager.java | 2 +- .../smackx/bytestreams/socks5/Socks5ClientForInitiator.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename source/org/jivesoftware/{smackx/packet => smack/util}/SyncPacketSend.java (95%) diff --git a/source/org/jivesoftware/smackx/packet/SyncPacketSend.java b/source/org/jivesoftware/smack/util/SyncPacketSend.java similarity index 95% rename from source/org/jivesoftware/smackx/packet/SyncPacketSend.java rename to source/org/jivesoftware/smack/util/SyncPacketSend.java index 8ce87f92b..a1c238aeb 100644 --- a/source/org/jivesoftware/smackx/packet/SyncPacketSend.java +++ b/source/org/jivesoftware/smack/util/SyncPacketSend.java @@ -11,7 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.jivesoftware.smackx.packet; +package org.jivesoftware.smack.util; import org.jivesoftware.smack.PacketCollector; import org.jivesoftware.smack.SmackConfiguration; diff --git a/source/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManager.java b/source/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManager.java index 6c4e1b57a..ef5253154 100644 --- a/source/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManager.java +++ b/source/org/jivesoftware/smackx/bytestreams/ibb/InBandBytestreamManager.java @@ -27,11 +27,11 @@ import org.jivesoftware.smack.ConnectionCreationListener; import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.XMPPError; +import org.jivesoftware.smack.util.SyncPacketSend; import org.jivesoftware.smackx.bytestreams.BytestreamListener; import org.jivesoftware.smackx.bytestreams.BytestreamManager; import org.jivesoftware.smackx.bytestreams.ibb.packet.Open; import org.jivesoftware.smackx.filetransfer.FileTransferManager; -import org.jivesoftware.smackx.packet.SyncPacketSend; /** * The InBandBytestreamManager class handles establishing In-Band Bytestreams as specified in the Date: Sat, 8 Oct 2011 03:48:29 +0000 Subject: [PATCH 02/13] SMACK-263 Applied patch for setting file info for transfer git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_2_0@12854 b35dd754-fafc-0310-a699-88a17e54d16e --- .../smackx/filetransfer/FileTransfer.java | 26 +++++++++---------- .../filetransfer/OutgoingFileTransfer.java | 15 ++++++----- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/source/org/jivesoftware/smackx/filetransfer/FileTransfer.java b/source/org/jivesoftware/smackx/filetransfer/FileTransfer.java index f7c2ad934..46c77b53a 100644 --- a/source/org/jivesoftware/smackx/filetransfer/FileTransfer.java +++ b/source/org/jivesoftware/smackx/filetransfer/FileTransfer.java @@ -130,10 +130,10 @@ public abstract class FileTransfer { /** * Returns true if the transfer has been cancelled, if it has stopped because - * of a an error, or the transfer completed succesfully. + * of a an error, or the transfer completed successfully. * * @return Returns true if the transfer has been cancelled, if it has stopped - * because of a an error, or the transfer completed succesfully. + * because of a an error, or the transfer completed successfully. */ public boolean isDone() { return status == Status.cancelled || status == Status.error @@ -141,9 +141,9 @@ public abstract class FileTransfer { } /** - * Retuns the current status of the file transfer. + * Returns the current status of the file transfer. * - * @return Retuns the current status of the file transfer. + * @return Returns the current status of the file transfer. */ public Status getStatus() { return status; @@ -158,7 +158,7 @@ public abstract class FileTransfer { * during the transfer, the type of error can be retrieved through this * method. * - * @return Returns the type of error that occured if one has occured. + * @return Returns the type of error that occurred if one has occurred. */ public Error getError() { return error; @@ -166,9 +166,9 @@ public abstract class FileTransfer { /** * If an exception occurs asynchronously it will be stored for later - * retrival. If there is an error there maybe an exception set. + * retrieval. If there is an error there maybe an exception set. * - * @return The exception that occured or null if there was no exception. + * @return The exception that occurred or null if there was no exception. * @see #getError() */ public Exception getException() { @@ -246,7 +246,7 @@ public abstract class FileTransfer { public enum Status { /** - * An error occured during the transfer. + * An error occurred during the transfer. * * @see FileTransfer#getError() */ @@ -259,7 +259,7 @@ public abstract class FileTransfer { /** * The file transfer is being negotiated with the peer. The party - * recieving the file has the option to accept or refuse a file transfer + * Receiving the file has the option to accept or refuse a file transfer * request. If they accept, then the process of stream negotiation will * begin. If they refuse the file will not be transfered. * @@ -283,7 +283,7 @@ public abstract class FileTransfer { negotiating_stream("Negotiating Stream"), /** - * After the stream negotitation has completed the intermediate state + * After the stream negotiation has completed the intermediate state * between the time when the negotiation is finished and the actual * transfer begins. */ @@ -302,7 +302,7 @@ public abstract class FileTransfer { complete("Complete"), /** - * The file transfer was canceled + * The file transfer was cancelled */ cancelled("Cancelled"); @@ -348,12 +348,12 @@ public abstract class FileTransfer { no_response("The remote user did not respond or the connection timed out."), /** - * An error occured over the socket connected to send the file. + * An error occurred over the socket connected to send the file. */ connection("An error occured over the socket connected to send the file."), /** - * An error occured while sending or recieving the file + * An error occurred while sending or receiving the file */ stream("An error occured while sending or recieving the file."); diff --git a/source/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java b/source/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java index 88822fd86..8068b7ef4 100644 --- a/source/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java +++ b/source/org/jivesoftware/smackx/filetransfer/OutgoingFileTransfer.java @@ -80,7 +80,7 @@ public class OutgoingFileTransfer extends FileTransfer { /** * Returns the output stream connected to the peer to transfer the file. It - * is only available after it has been succesfully negotiated by the + * is only available after it has been successfully negotiated by the * {@link StreamNegotiator}. * * @return Returns the output stream connected to the peer to transfer the @@ -120,6 +120,7 @@ public class OutgoingFileTransfer extends FileTransfer { + " been attempted on this file transfer"); } try { + setFileInfo(fileName, fileSize); this.outputStream = negotiateStream(fileName, fileSize, description); } catch (XMPPException e) { handleXMPPException(e); @@ -159,6 +160,7 @@ public class OutgoingFileTransfer extends FileTransfer { "The negotation process has already" + " been attempted for this file transfer"); } + setFileInfo(fileName, fileSize); this.callback = progress; transferThread = new Thread(new Runnable() { public void run() { @@ -184,7 +186,7 @@ public class OutgoingFileTransfer extends FileTransfer { /** * This method handles the stream negotiation process and transmits the file - * to the remote user. It returns immediatly and the progress of the file + * to the remote user. It returns immediately and the progress of the file * transfer can be monitored through several methods: * *