mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 09:39:39 +02:00
CS-4346 - Added method to send a stream instead of a file. Also added a way of getting the sid for a transfer. To be reviewed by Gato. Migrated from 3.0.4
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@10556 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
8d07e07379
commit
708284ca46
3 changed files with 75 additions and 12 deletions
|
@ -19,9 +19,6 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.filetransfer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.filter.AndFilter;
|
||||
|
@ -30,9 +27,11 @@ import org.jivesoftware.smack.filter.PacketTypeFilter;
|
|||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.Packet;
|
||||
import org.jivesoftware.smack.packet.XMPPError;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smackx.packet.StreamInitiation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* The file transfer manager class handles the sending and recieving of files.
|
||||
* To send a file invoke the {@link #createOutgoingFileTransfer(String)} method.
|
||||
|
@ -131,12 +130,13 @@ public class FileTransferManager {
|
|||
* @return The send file object on which the negotiated transfer can be run.
|
||||
*/
|
||||
public OutgoingFileTransfer createOutgoingFileTransfer(String userID) {
|
||||
if (userID == null || StringUtils.parseName(userID).length() <= 0
|
||||
|| StringUtils.parseServer(userID).length() <= 0
|
||||
|| StringUtils.parseResource(userID).length() <= 0) {
|
||||
throw new IllegalArgumentException(
|
||||
"The provided user id was not fully qualified");
|
||||
}
|
||||
// Why is this only accepting fully qualified JID?
|
||||
// if (userID == null || StringUtils.parseName(userID).length() <= 0
|
||||
// || StringUtils.parseServer(userID).length() <= 0
|
||||
// || StringUtils.parseResource(userID).length() <= 0) {
|
||||
// throw new IllegalArgumentException(
|
||||
// "The provided user id was not fully qualified");
|
||||
// }
|
||||
|
||||
return new OutgoingFileTransfer(connection.getUser(), userID,
|
||||
fileTransferNegotiator.getNextStreamID(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue