Class StreamInitiation.File
- java.lang.Object
-
- org.jivesoftware.smackx.si.packet.StreamInitiation.File
-
- All Implemented Interfaces:
org.jivesoftware.smack.packet.Element,org.jivesoftware.smack.packet.ExtensionElement,org.jivesoftware.smack.packet.FullyQualifiedElement,org.jivesoftware.smack.packet.NamedElement,org.jivesoftware.smack.packet.XmlLangElement
- Enclosing class:
- StreamInitiation
public static class StreamInitiation.File extends java.lang.Object implements org.jivesoftware.smack.packet.ExtensionElement- 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.
-
-
Constructor Summary
Constructors Constructor Description File(java.lang.String name, long size)Constructor providing the name of the file and its size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.DategetDate()Returns the date that the file was last modified.java.lang.StringgetDesc()Returns the description of the file.java.lang.StringgetElementName()java.lang.StringgetHash()Returns the MD5 sum of the file's contents.java.lang.StringgetName()Returns the file's name.java.lang.StringgetNamespace()longgetSize()Returns the file's size.booleanisRanged()Returns whether or not the initiator can support a range for the file transfer.voidsetDate(java.util.Date date)Sets the date that the file was last modified.voidsetDesc(java.lang.String desc)Sets the description of the file.voidsetHash(java.lang.String hash)Sets the MD5 sum of the file's contents.voidsetRanged(boolean isRanged)True if a range can be provided and false if it cannot.java.lang.StringtoXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the file's name.- Returns:
- Returns the file's name.
-
getSize
public long getSize()
Returns the file's size.- Returns:
- Returns the file's size.
-
setHash
public void setHash(java.lang.String hash)
Sets the MD5 sum of the file's contents.- Parameters:
hash- The MD5 sum of the file's contents.
-
getHash
public java.lang.String getHash()
Returns the MD5 sum of the file's contents.- Returns:
- Returns the MD5 sum of the file's contents
-
setDate
public void setDate(java.util.Date date)
Sets the date that the file was last modified.- Parameters:
date- The date that the file was last modified.
-
getDate
public java.util.Date getDate()
Returns the date that the file was last modified.- Returns:
- Returns the date that the file was last modified.
-
setDesc
public void setDesc(java.lang.String desc)
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
public java.lang.String getDesc()
Returns the description of the file.- Returns:
- Returns the description of the file.
-
setRanged
public void setRanged(boolean isRanged)
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
public boolean 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
public java.lang.String getElementName()
- Specified by:
getElementNamein interfaceorg.jivesoftware.smack.packet.NamedElement
-
getNamespace
public java.lang.String getNamespace()
- Specified by:
getNamespacein interfaceorg.jivesoftware.smack.packet.FullyQualifiedElement
-
toXML
public java.lang.String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
- Specified by:
toXMLin interfaceorg.jivesoftware.smack.packet.Element
-
-