Package rocks.xmpp.extensions.si.profile.filetransfer.model

Examples of rocks.xmpp.extensions.si.profile.filetransfer.model.SIFileTransferOffer$SIRange


        }

        // Before a Stream Initiation is attempted the Sender should be sure that the Receiver supports both Stream Initiation and the specific profile that they wish to use.
        if (entityCapabilitiesManager.isSupported(StreamInitiation.NAMESPACE, recipient) && entityCapabilitiesManager.isSupported(SIFileTransferOffer.NAMESPACE, recipient)) {

            SIFileTransferOffer fileTransfer = new SIFileTransferOffer(file.getName(), file.length(), new Date(file.lastModified()), null, description, null);
            String mimeType;

            try {
                mimeType = Files.probeContentType(file.toPath());
            } catch (IOException e) {
View Full Code Here


                "          hash='552da749930852c69ae5d2141d3766b1'\n" +
                "          date='1969-07-21T02:56:15Z'>\n" +
                "      <desc>This is a test. If this were a real file...</desc>\n" +
                "    </file>";

        SIFileTransferOffer fileTransfer = unmarshal(xml, SIFileTransferOffer.class);
        Assert.assertNotNull(fileTransfer);
        Assert.assertEquals(fileTransfer.getName(), "test.txt");
        Assert.assertEquals(fileTransfer.getSize(), 1022);
        Assert.assertEquals(fileTransfer.getHashes().size(), 1);
        Assert.assertEquals(fileTransfer.getHashes().get(0).getAlgorithm(), "md5");
        Assert.assertEquals(new BigInteger(1, fileTransfer.getHashes().get(0).getValue()).toString(16), "552da749930852c69ae5d2141d3766b1");
        Assert.assertNotNull(fileTransfer.getDate());
        Assert.assertEquals(fileTransfer.getDescription(), "This is a test. If this were a real file...");
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.si.profile.filetransfer.model.SIFileTransferOffer$SIRange

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.