blob: caeb2c809cd64ac8c3ff24e725c8f0e87b44ec5d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
package de.thedevstack.smackx.filetransferhttp.element;
import org.jivesoftware.smack.packet.NamedElement;
import org.jivesoftware.smack.util.XmlStringBuilder;
public class RemoteFileInfo implements NamedElement {
private final String filename;
private final long size;
private String contentType;
public RemoteFileInfo(String filename, long size) {
this.filename = filename;
this.size = size;
}
public RemoteFileInfo(String filename, long size, String contentType) {
this(filename, size);
this.contentType = contentType;
}
public String getFilename() {
return filename;
}
public long getSize() {
return size;
}
public String getContentType() {
return contentType;
}
public void setContentType(String contentType) {
this.contentType = contentType;
}
@Override
public String getElementName() {
return "file-info";
}
@Override
public CharSequence toXML() {
XmlStringBuilder xml = new XmlStringBuilder(this);
xml.rightAngleBracket();
xml.element("filename", this.filename);
xml.optElement("size", this.size);
xml.optElement("content-type", this.contentType);
xml.closeElement(this);
return xml;
}
}
|