Package org.jivesoftware.smackx.filetransfer

Examples of org.jivesoftware.smackx.filetransfer.FileTransferManager


    FileDialog fileDialog = new FileDialog(parent,SWT.SINGLE|SWT.OPEN);
    fileDialog.setText("Choose file to send to " + user);
    String file = fileDialog.open();
    if(file == null) return false;
   
    FileTransferManager manager = new FileTransferManager(account.xmpp.getConnection());
    final OutgoingFileTransfer outgoingFileTransfer = manager.createOutgoingFileTransfer(user);
   
    final File f = new File(file);
    InputDialog descriptionInput = new InputDialog(parent,
        "Sending file to " + user,
        "Please Provide a description of the file (" + f.getName() + ") " +
View Full Code Here


                  }
                }
              });
            }
          });
          FileTransferManager fileTransferManager = new FileTransferManager(conn);
          fileTransferManager.addFileTransferListener(new FileTransferListener() {
            public void fileTransferRequest(final FileTransferRequest request) {
              PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
                public void run() {
                  Shell parent = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
                  boolean accept = MessageDialog.openConfirm(parent,
View Full Code Here

    }


    // strJidreceiver muss der Form "test2@192.168.1.143/Smack" entsprechen, also mit / und der Ressource
    public void sendFile(String strJidreceiver){
        FileTransferManager manager = new FileTransferManager(xmppconnection);
        OutgoingFileTransfer transfer = manager.createOutgoingFileTransfer(strJidreceiver);

        OpenDialog opendialogsendfile = new OpenDialog(true);
        if (opendialogsendfile.getAbortedStatus() != true){
            try {
                transfer.sendFile(new File(opendialogsendfile.getCompletePath()),opendialogsendfile.getFileDescription());
View Full Code Here

    public void receiveFile(){
        // der Status muss available sein, sonst ist das Senden nicht möglich
        Presence presence = new Presence(Presence.Type.available);
        xmppconnection.sendPacket(presence);

        FileTransferManager manager = new FileTransferManager(xmppconnection);
        manager.addFileTransferListener(new FileTransferListener() {
            public void fileTransferRequest(FileTransferRequest request) {
                ProgressMonitorInputStream pm = null;
                try {
                    int result = JOptionPane.showConfirmDialog( null, "Möchten Sie einen Dateitransfer von " + request.getRequestor() + " annehmen?","eingehender Dateitransfer", 0);
                    if(result == 0){
View Full Code Here

    }
    else if(conn.isAuthenticated() != true){
      throw new IllegalArgumentException("user has not connected!");
    }
    this.connection = conn;
    fileTransferManager = new FileTransferManager(connection);
    this.listener = listener;
    ibbManager = InBandBytestreamManager.getByteStreamManager(conn);
    fileTransferManager.addFileTransferListener(new FileTranserHandler());
   
   
View Full Code Here

        } catch (NotConnectedException e) {
          logger.error("Error sending message '{}'", message, e);
        }
      } else {
        // Create the file transfer manager
        FileTransferManager manager = new FileTransferManager(conn);

        // Create the outgoing file transfer
        OutgoingFileTransfer transfer = manager.createOutgoingFileTransfer(to);

        InputStream is = null;
        try {
          URL url = new URL(attachmentUrl);
          // Send the file
View Full Code Here

   * @param connection
   */
  public void setConnection(XMPPConnection connection) {
    if (connection != null) {
      synchronized (incomingListeners) {
        this.manager = new FileTransferManager(connection);
        for (final Iterator i = incomingListeners.iterator(); i.hasNext();) {
          final XMPPFileTransferRequestListener ftl = (XMPPFileTransferRequestListener) i.next();
          this.manager.addFileTransferListener(ftl);
        }
      }
View Full Code Here

TOP

Related Classes of org.jivesoftware.smackx.filetransfer.FileTransferManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.