src/net/java/sip/communicator/impl/gui/main/chat/MetaContactChatTransport.java
/**
     * Sends the given file through this chat transport file transfer operation
     * set.
     * @param file the file to send
     * @return the <tt>FileTransfer</tt> object charged to transfer the file
     * @throws Exception if anything goes wrong
     */
Sends the given file through this chat transport file transfer operation
set.
@param file the file to send
@return the FileTransfer object charged to transfer the file
@throws Exception if anything goes wrong
Sends the given file through this chat transport file transfer operation set . @param file the file to send @return the FileTransfer object charged to transfer the file @throws Exception if anything goes wrong
private FileTransfer sendFile(File file, boolean isMultimediaMessage)
        throws Exception
    {
        if (!allowsFileTransfer())
            return null;
        if (FileUtils.isImage(file.getName()))
        {
            OperationSetThumbnailedFileFactory tfOpSet
                = contact
                    .getProtocolProvider()
                        .getOperationSet(
                            OperationSetThumbnailedFileFactory.class);
            if (tfOpSet != null)
            {
                byte[] thumbnail = getFileThumbnail(file);
                if (thumbnail != null && thumbnail.length > 0)
                {
                    file = tfOpSet.createFileWithThumbnail(
                        file, THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT,
                        "image/png", thumbnail);
                }
            }
        }
        if(isMultimediaMessage)
        {
            OperationSetSmsMessaging smsOpSet = contact.getProtocolProvider()
                .getOperationSet(OperationSetSmsMessaging.class);
            if(smsOpSet == null)
                return null;
            return smsOpSet.sendMultimediaFile(contact, file);
        }
        else
        {
            OperationSetFileTransfer ftOpSet = contact.getProtocolProvider()
                .getOperationSet(OperationSetFileTransfer.class);
            return ftOpSet.sendFile(contact, file);
        }
    }
private FileTransfer sendFile ( File file , boolean isMultimediaMessage ) throws Exception { if ( ! allowsFileTransfer ( ) ) return null ; if ( FileUtils . isImage ( file . getName ( ) ) ) { OperationSetThumbnailedFileFactory tfOpSet = contact . getProtocolProvider ( ) . getOperationSet ( OperationSetThumbnailedFileFactory . class ) ; if ( tfOpSet != null ) { byte [ ] thumbnail = getFileThumbnail ( file ) ; if ( thumbnail != null && thumbnail . length > 0 ) { file = tfOpSet . createFileWithThumbnail ( file , THUMBNAIL_WIDTH , THUMBNAIL_HEIGHT , "image/png" , thumbnail ) ; } } } if ( isMultimediaMessage ) { OperationSetSmsMessaging smsOpSet = contact . getProtocolProvider ( ) . getOperationSet ( OperationSetSmsMessaging . class ) ; if ( smsOpSet == null ) return null ; return smsOpSet . sendMultimediaFile ( contact , file ) ; } else { OperationSetFileTransfer ftOpSet = contact . getProtocolProvider ( ) . getOperationSet ( OperationSetFileTransfer . class ) ; return ftOpSet . sendFile ( contact , file ) ; } }
Sends the given file through this chat transport file transfer operation
 set.
Sends the given file through this chat transport file transfer operation set .
// If this chat transport does not support instant messaging we do // nothing here. // Create a thumbnailed file if possible.