/** * Creates an OutgoingFileTransfer to send a file to another user. * * @param userID * The fully qualified jabber ID (i.e. full JID) with resource of the user to * send the file to. * @return The send file object on which the negotiated transfer can be run. * @exception IllegalArgumentException if userID is null or not a full JID */ public OutgoingFileTransfer createOutgoingFileTransfer(EntityFullJid userID) { // We need to create outgoing file transfers with a full JID since this method will later // use XEP-0095 to negotiate the stream. This is done with IQ stanzas that need to be addressed to a full JID // in order to reach an client entity. if (userID == null) { throw new IllegalArgumentException("userID was null"); } return new OutgoingFileTransfer(connection().getUser(), userID, FileTransferNegotiator.getNextStreamID(), fileTransferNegotiator); }
/** * Creates an OutgoingFileTransfer to send a file to another user. * * @param userID * The fully qualified jabber ID with resource of the user to * send the file to. * @return The send file object on which the negotiated transfer can be run. */ public OutgoingFileTransfer createOutgoingFileTransfer(String userID) { // 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(), fileTransferNegotiator); }
/** * Creates an OutgoingFileTransfer to send a file to another user. * * @param userID * The fully qualified jabber ID with resource of the user to * send the file to. * @return The send file object on which the negotiated transfer can be run. */ public OutgoingFileTransfer createOutgoingFileTransfer(String userID) { // 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(), fileTransferNegotiator); }
/** * Creates an OutgoingFileTransfer to send a file to another user. * * @param userID * The fully qualified jabber ID with resource of the user to * send the file to. * @return The send file object on which the negotiated transfer can be run. */ public OutgoingFileTransfer createOutgoingFileTransfer(String userID) { // 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(), fileTransferNegotiator); }
/** * Creates an OutgoingFileTransfer to send a file to another user. * * @param userID * The fully qualified jabber ID with resource of the user to * send the file to. * @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"); } return new OutgoingFileTransfer(connection.getUser(), userID, fileTransferNegotiator.getNextStreamID(), fileTransferNegotiator); }