source: branches/2.2/jabberit_messenger/java_source/src/nu/fw/jeti/plugins/filetransfer/IQSiHandler.java @ 3102

Revision 3102, 1.3 KB checked in by amuller, 14 years ago (diff)

Ticket #986 - Efetuado merge para o Branch 2.2( atualizacao do modulo)

  • Property svn:executable set to *
Line 
1// Created on 20-okt-2004
2package nu.fw.jeti.plugins.filetransfer;
3
4import nu.fw.jeti.jabber.elements.Extension;
5import nu.fw.jeti.jabber.elements.XData;
6import nu.fw.jeti.jabber.elements.XMPPErrorTag;
7import nu.fw.jeti.jabber.handlers.ExtensionHandler;
8import nu.fw.jeti.util.Log;
9
10import org.xml.sax.Attributes;
11
12/**
13 * @author E.S. de Boer
14 *
15 */
16public class IQSiHandler extends ExtensionHandler
17{
18        private String mimeType;
19        private String id;
20        private String profile;
21        private XData form;
22        private XSiFileTransfer siprofile;
23       
24        public void startHandling(Attributes attr)
25        {
26                mimeType=attr.getValue("mime-type");
27                id=attr.getValue("id");
28                profile=attr.getValue("profile");
29                form=null;
30                siprofile=null;
31        }
32       
33        public void addExtension(Extension extension)
34        {
35                if(extension instanceof XData)
36                {
37                        form = (XData)extension;
38                }
39                else if(extension instanceof XSiFileTransfer)siprofile = (XSiFileTransfer)extension;
40                else Log.notParsedXML("Si Extension not known" + extension);
41        }
42//      public void endElement(String name)
43//      {
44//              System.out.println(name);
45//              data = getText();
46//              clearCurrentChars();
47//      }
48
49        public Extension build()
50        {
51                if(!getName().equals("si"))return new XMPPErrorTag(getName(),"http://jabber.org/protocol/si");
52                return new IQSi(id,profile,mimeType,form,siprofile);
53        }
54}
55/*
56 * Overrides for emacs
57 * Local variables:
58 * tab-width: 4
59 * End:
60 */
Note: See TracBrowser for help on using the repository browser.