Package rocks.xmpp.extensions.filetransfer

Examples of rocks.xmpp.extensions.filetransfer.FileTransfer.transfer()


                    // Send initial presence
                    xmppSession.send(new Presence());

                    FileTransferManager fileTransferManager = xmppSession.getExtensionManager(FileTransferManager.class);
                    FileTransfer fileTransfer = fileTransferManager.offerFile(new File("info.png"), "Description", new Jid("222", xmppSession.getDomain(), "filetransfer"), 5000);
                    fileTransfer.transfer();

                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
View Full Code Here


                                try {
                                    OutputStream outputStream = new FileOutputStream("test222.png");
                                    //e.reject();

                                    final FileTransfer fileTransfer = e.accept(outputStream);
                                    fileTransfer.transfer();

                                    AnimationTimer animationTimer = new AnimationTimer() {
                                        @Override
                                        public void handle(long now) {
                                            System.out.println(fileTransfer.getProgress());
View Full Code Here

                    fileTransferManager.addFileTransferOfferListener(new FileTransferOfferListener() {
                        @Override
                        public void fileTransferOffered(FileTransferOfferEvent e) {
                            try {
                                FileTransfer fileTransfer = e.accept(new FileOutputStream(new File("test.png")));
                                fileTransfer.transfer();
                            } catch (IOException e1) {
                                e1.printStackTrace();
                            }
                        }
                    });
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.