diff options
author | steckbrief <steckbrief@chefmail.de> | 2016-08-23 09:46:51 +0200 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2016-08-23 09:46:51 +0200 |
commit | 2d462a746ea6e733f9f2836b181795c80de5aae5 (patch) | |
tree | 4aad498f7ce8fe0dc60e69c05cd64f374a500858 /src/main/java/de/thedevstack/conversationsplus/xmpp/httpupload/SlotRequestPacket.java | |
parent | e7089c55ac72f716e17203a9b8732b2b5c82c150 (diff) |
xmpp.httpupload moved to new namespace xmpp.filetransfer.http.upload; delete parts of xmpp.filetransfer.http moved to .delete package
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/xmpp/httpupload/SlotRequestPacket.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/xmpp/httpupload/SlotRequestPacket.java | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/xmpp/httpupload/SlotRequestPacket.java b/src/main/java/de/thedevstack/conversationsplus/xmpp/httpupload/SlotRequestPacket.java deleted file mode 100644 index d470d2f5..00000000 --- a/src/main/java/de/thedevstack/conversationsplus/xmpp/httpupload/SlotRequestPacket.java +++ /dev/null @@ -1,53 +0,0 @@ -package de.thedevstack.conversationsplus.xmpp.httpupload; - -import de.thedevstack.conversationsplus.xml.Element; -import de.thedevstack.conversationsplus.xmpp.stanzas.IqPacket; - -/** - * - */ -public class SlotRequestPacket extends IqPacket { - public static final String ELEMENT_NAME = "request"; - public static final String FILENAME_ELEMENT_NAME = "filename"; - public static final String FILESIZE_ELEMENT_NAME = "size"; - public static final String MIME_ELEMENT_NAME = "content-type"; - private Element requestElement; - private String filename; - private long filesize; - private String mime; - - private SlotRequestPacket() { - super(TYPE.GET); - this.requestElement = super.addChild(SlotRequestPacket.ELEMENT_NAME, HttpUpload.NAMESPACE); - } - - public SlotRequestPacket(String filename, long filesize) { - this(); - this.setFilename(filename); - this.setFilesize(filesize); - } - - public void setFilename(String filename) { - if (null == filename || filename.isEmpty()) { - throw new IllegalArgumentException("filename must not be null or empty."); - } - this.filename = filename; - this.requestElement.addChild(FILENAME_ELEMENT_NAME).setContent(filename); - } - - public void setFilesize(long filesize) { - if (0 >= filesize) { - throw new IllegalArgumentException("filesize must not be null or empty."); - } - this.filesize = filesize; - this.requestElement.addChild(FILESIZE_ELEMENT_NAME).setContent(String.valueOf(filesize)); - } - - public void setMime(String mime) { - if (null == mime || mime.isEmpty()) { - throw new IllegalArgumentException("mime type must not be null or empty."); - } - this.mime = mime; - this.requestElement.addChild(MIME_ELEMENT_NAME).setContent(mime); - } -} |