Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.jabber.extensions.thumbnail
Class FileElement

java.lang.Object
  extended by org.jivesoftware.smackx.packet.StreamInitiation.File
      extended by net.java.sip.communicator.impl.protocol.jabber.extensions.thumbnail.FileElement
All Implemented Interfaces:
org.jivesoftware.smack.packet.PacketExtension, org.jivesoftware.smack.provider.IQProvider

public class FileElement
extends org.jivesoftware.smackx.packet.StreamInitiation.File
implements org.jivesoftware.smack.provider.IQProvider

The FileElement extends the smackx StreamInitiation.File in order to provide a file that supports thumbnails.

Author:
Yana Stamcheva

Field Summary
static String ELEMENT_NAME
          The element name of this IQProvider.
static String NAMESPACE
          The namespace of this IQProvider.
 
Constructor Summary
FileElement()
          An empty constructor used to initialize this class as an IQProvider.
FileElement(org.jivesoftware.smackx.packet.StreamInitiation.File baseFile, ThumbnailElement thumbnail)
          Creates a FileElement by specifying a base file and a thumbnail to extend it with.
FileElement(String name, long size)
          Creates a FileElement by specifying the name and the size of the file.
 
Method Summary
 ThumbnailElement getThumbnailElement()
          Returns the ThumbnailElement contained in this FileElement.
 org.jivesoftware.smack.packet.IQ parseIQ(org.xmlpull.v1.XmlPullParser parser)
          Parses the given parser in order to create a FileElement from it.
 void setThumbnailElement(ThumbnailElement thumbnail)
          Sets the given thumbnail to this FileElement.
 String toXML()
          Represents this FileElement in an XML.
 
Methods inherited from class org.jivesoftware.smackx.packet.StreamInitiation.File
getDate, getDesc, getElementName, getHash, getName, getNamespace, getSize, isRanged, setDate, setDesc, setHash, setRanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEMENT_NAME

public static final String ELEMENT_NAME
The element name of this IQProvider.

See Also:
Constant Field Values

NAMESPACE

public static final String NAMESPACE
The namespace of this IQProvider.

See Also:
Constant Field Values
Constructor Detail

FileElement

public FileElement()
An empty constructor used to initialize this class as an IQProvider.


FileElement

public FileElement(org.jivesoftware.smackx.packet.StreamInitiation.File baseFile,
                   ThumbnailElement thumbnail)
Creates a FileElement by specifying a base file and a thumbnail to extend it with.

Parameters:
baseFile - the file used as a base
thumbnail - the thumbnail to add

FileElement

public FileElement(String name,
                   long size)
Creates a FileElement by specifying the name and the size of the file.

Parameters:
name - the name of the file
size - the size of the file
Method Detail

toXML

public String toXML()
Represents this FileElement in an XML.

Specified by:
toXML in interface org.jivesoftware.smack.packet.PacketExtension
Overrides:
toXML in class org.jivesoftware.smackx.packet.StreamInitiation.File
See Also:
StreamInitiation.File.toXML()

getThumbnailElement

public ThumbnailElement getThumbnailElement()
Returns the ThumbnailElement contained in this FileElement.

Returns:
the ThumbnailElement contained in this FileElement

setThumbnailElement

public void setThumbnailElement(ThumbnailElement thumbnail)
Sets the given thumbnail to this FileElement.

Parameters:
thumbnail - the ThumbnailElement to set

parseIQ

public org.jivesoftware.smack.packet.IQ parseIQ(org.xmlpull.v1.XmlPullParser parser)
                                         throws Exception
Parses the given parser in order to create a FileElement from it.

Specified by:
parseIQ in interface org.jivesoftware.smack.provider.IQProvider
Parameters:
parser - the parser to parse
Throws:
Exception
See Also:
IQProvider.parseIQ(XmlPullParser)

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.