Class StreamInitiation.File
java.lang.Object
org.jivesoftware.smackx.si.packet.StreamInitiation.File
- All Implemented Interfaces:
Element
,ExtensionElement
,NamedElement
,XmlElement
,XmlLangElement
- Enclosing class:
- StreamInitiation
- size: The size, in bytes, of the data to be sent.
- name: The name of the file that the Sender wishes to send.
- date: The last modification time of the file. This is specified using the DateTime profile as described in Jabber Date and Time Profiles.
- hash: The MD5 sum of the file contents.
<desc> is used to provide a sender-generated description of the file so the receiver can better understand what is being sent. It MUST NOT be sent in the result.
When <range> is sent in the offer, it should have no attributes. This signifies that the sender can do ranged transfers. When a Stream Initiation result is sent with the <range> element, it uses these attributes:
- offset: Specifies the position, in bytes, to start transferring the file data from. This defaults to zero (0) if not specified.
- length - Specifies the number of bytes to retrieve starting at offset. This defaults to the length of the file from offset to the end.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetDate()
Returns the date that the file was last modified.getDesc()
Returns the description of the file.Returns the root element name.getHash()
Returns the MD5 sum of the file's contents.getName()
Returns the file's name.Returns the root element XML namespace.long
getSize()
Returns the file's size.boolean
isRanged()
Returns whether or not the initiator can support a range for the file transfer.void
Sets the date that the file was last modified.void
Sets the description of the file.void
Sets the MD5 sum of the file's contents.void
setRanged
(boolean isRanged) True if a range can be provided and false if it cannot.toXML
(XmlEnvironment enclosingNamespace) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jivesoftware.smack.packet.XmlElement
getLanguage, getQName
-
Field Details
-
ELEMENT
- See Also:
-
NAMESPACE
- See Also:
-
QNAME
-
-
Constructor Details
-
File
Constructor providing the name of the file and its size.- Parameters:
name
- The name of the file.size
- The size of the file in bytes.
-
-
Method Details
-
getName
Returns the file's name.- Returns:
- Returns the file's name.
-
getSize
Returns the file's size.- Returns:
- Returns the file's size.
-
setHash
Sets the MD5 sum of the file's contents.- Parameters:
hash
- The MD5 sum of the file's contents.
-
getHash
Returns the MD5 sum of the file's contents.- Returns:
- Returns the MD5 sum of the file's contents
-
setDate
Sets the date that the file was last modified.- Parameters:
date
- The date that the file was last modified.
-
getDate
Returns the date that the file was last modified.- Returns:
- Returns the date that the file was last modified.
-
setDesc
Sets the description of the file.- Parameters:
desc
- The description of the file so that the file receiver can know what file it is.
-
getDesc
Returns the description of the file.- Returns:
- Returns the description of the file.
-
setRanged
True if a range can be provided and false if it cannot.- Parameters:
isRanged
- True if a range can be provided and false if it cannot.
-
isRanged
Returns whether or not the initiator can support a range for the file transfer.- Returns:
- Returns whether or not the initiator can support a range for the file transfer.
-
getElementName
Description copied from interface:NamedElement
Returns the root element name.- Specified by:
getElementName
in interfaceNamedElement
- Returns:
- the element name.
-
getNamespace
Description copied from interface:XmlElement
Returns the root element XML namespace.- Specified by:
getNamespace
in interfaceXmlElement
- Returns:
- the namespace.
-
toXML
-