aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/xmpp/filetransfer/http/delete/DeleteSlotRequestPacket.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-08-23 09:46:51 +0200
committersteckbrief <steckbrief@chefmail.de>2016-08-23 09:46:51 +0200
commit2d462a746ea6e733f9f2836b181795c80de5aae5 (patch)
tree4aad498f7ce8fe0dc60e69c05cd64f374a500858 /src/main/java/de/thedevstack/conversationsplus/xmpp/filetransfer/http/delete/DeleteSlotRequestPacket.java
parente7089c55ac72f716e17203a9b8732b2b5c82c150 (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/filetransfer/http/delete/DeleteSlotRequestPacket.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/xmpp/filetransfer/http/delete/DeleteSlotRequestPacket.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/xmpp/filetransfer/http/delete/DeleteSlotRequestPacket.java b/src/main/java/de/thedevstack/conversationsplus/xmpp/filetransfer/http/delete/DeleteSlotRequestPacket.java
new file mode 100644
index 00000000..e389d851
--- /dev/null
+++ b/src/main/java/de/thedevstack/conversationsplus/xmpp/filetransfer/http/delete/DeleteSlotRequestPacket.java
@@ -0,0 +1,34 @@
+package de.thedevstack.conversationsplus.xmpp.filetransfer.http.delete;
+
+import de.thedevstack.conversationsplus.xml.Element;
+import de.thedevstack.conversationsplus.xmpp.filetransfer.http.FileTransferHttp;
+import de.thedevstack.conversationsplus.xmpp.stanzas.IqPacket;
+
+/**
+ * Created by steckbrief on 21.08.2016.
+ */
+public class DeleteSlotRequestPacket extends IqPacket {
+ public static final String ELEMENT_NAME = "request";
+ public static final String FILEURL_ELEMENT_NAME = "fileurl";
+ private Element requestElement;
+ private String fileurl;
+
+ private DeleteSlotRequestPacket() {
+ super(TYPE.GET);
+ this.requestElement = super.addChild(DeleteSlotRequestPacket.ELEMENT_NAME, FileTransferHttp.NAMESPACE);
+ this.requestElement.setAttribute("type", "delete");
+ }
+
+ public DeleteSlotRequestPacket(String fileurl) {
+ this();
+ this.setFileURL(fileurl);
+ }
+
+ public void setFileURL(String fileurl) {
+ if (null == fileurl || fileurl.isEmpty()) {
+ throw new IllegalArgumentException("fileurl must not be null or empty.");
+ }
+ this.fileurl = fileurl;
+ this.requestElement.addChild(FILEURL_ELEMENT_NAME).setContent(fileurl);
+ }
+}