/** * Returns the file transfer negotiator related to a particular connection. * When this class is requested on a particular connection the file transfer * service is automatically enabled. * * @param connection The connection for which the transfer manager is desired * @return The FileTransferNegotiator */ public static synchronized FileTransferNegotiator getInstanceFor( final XMPPConnection connection) { FileTransferNegotiator fileTransferNegotiator = INSTANCES.get(connection); if (fileTransferNegotiator == null) { fileTransferNegotiator = new FileTransferNegotiator(connection); INSTANCES.put(connection, fileTransferNegotiator); } return fileTransferNegotiator; }
/** * Returns the file transfer negotiator related to a particular connection. * When this class is requested on a particular connection the file transfer * service is automatically enabled. * * @param connection The connection for which the transfer manager is desired * @return The IMFileTransferManager */ public static FileTransferNegotiator getInstanceFor( final Connection connection) { if (connection == null) { throw new IllegalArgumentException("Connection cannot be null"); } if (!connection.isConnected()) { return null; } if (transferObject.containsKey(connection)) { return transferObject.get(connection); } else { FileTransferNegotiator transfer = new FileTransferNegotiator( connection); setServiceEnabled(connection, true); transferObject.put(connection, transfer); return transfer; } }
/** * Returns the file transfer negotiator related to a particular connection. * When this class is requested on a particular connection the file transfer * service is automatically enabled. * * @param connection The connection for which the transfer manager is desired * @return The IMFileTransferManager */ public static FileTransferNegotiator getInstanceFor( final Connection connection) { if (connection == null) { throw new IllegalArgumentException("Connection cannot be null"); } if (!connection.isConnected()) { return null; } if (transferObject.containsKey(connection)) { return transferObject.get(connection); } else { FileTransferNegotiator transfer = new FileTransferNegotiator( connection); setServiceEnabled(connection, true); transferObject.put(connection, transfer); return transfer; } }
/** * Returns the file transfer negotiator related to a particular connection. * When this class is requested on a particular connection the file transfer * service is automatically enabled. * * @param connection The connection for which the transfer manager is desired * @return The IMFileTransferManager */ public static FileTransferNegotiator getInstanceFor( final XMPPConnection connection) { if (connection == null) { throw new IllegalArgumentException("Connection cannot be null"); } if (!connection.isConnected()) { return null; } if (transferObject.containsKey(connection)) { return (FileTransferNegotiator) transferObject.get(connection); } else { FileTransferNegotiator transfer = new FileTransferNegotiator( connection); setServiceEnabled(connection, true); transferObject.put(connection, transfer); return transfer; } }
/** * Returns the file transfer negotiator related to a particular connection. * When this class is requested on a particular connection the file transfer * service is automatically enabled. * * @param connection The connection for which the transfer manager is desired * @return The IMFileTransferManager */ public static FileTransferNegotiator getInstanceFor( final Connection connection) { if (connection == null) { throw new IllegalArgumentException("Connection cannot be null"); } if (!connection.isConnected()) { return null; } if (transferObject.containsKey(connection)) { return transferObject.get(connection); } else { FileTransferNegotiator transfer = new FileTransferNegotiator( connection); setServiceEnabled(connection, true); transferObject.put(connection, transfer); return transfer; } }