diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-02-06 10:01:13 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-02-06 10:01:13 +0100 |
commit | 754de6bb0449a577d2bb9c28cca6adf0ef9554f6 (patch) | |
tree | 279b405d94e0d86d10ed94bd34d919457944ead6 /src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/upload/HttpUploadFileTransferEntity.java | |
parent | cd633f13b8d7327e47994bb5a000f0c0b7089e7f (diff) |
relates FS#241: Implementation of http download based on okhttp
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/upload/HttpUploadFileTransferEntity.java (renamed from src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/upload/HttpFileTransferEntity.java) | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/upload/HttpFileTransferEntity.java b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/upload/HttpUploadFileTransferEntity.java index 985dafcb..54186983 100644 --- a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/upload/HttpFileTransferEntity.java +++ b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/upload/HttpUploadFileTransferEntity.java @@ -18,15 +18,15 @@ import de.thedevstack.conversationsplus.xmpp.filetransfer.http.upload.HttpUpload /** * */ -public class HttpFileTransferEntity extends FileTransferEntity { +public class HttpUploadFileTransferEntity extends FileTransferEntity { private HttpUploadSlot slot; private final byte[] key; private final boolean delayed; - public HttpFileTransferEntity(Message message, boolean delayed) { - super(message); + public HttpUploadFileTransferEntity(Message message, boolean delayed) { + super(message, true); this.getMessage().setHttpUploaded(true); - this.getMessage().setNoDownloadable(); // TODO Set rmeote file status to uploaded + this.getMessage().setNoDownloadable(); FileParams fileParams = this.getMessage().getFileParams(); if (null == fileParams) { fileParams = new FileParams(); @@ -45,6 +45,17 @@ public class HttpFileTransferEntity extends FileTransferEntity { this.delayed = delayed; } + /** + * Returns the global transferable status. + * + * @return {@value STATUS_FAILED} if #isFailed returns <code>true</code>, {@value STATUS_UPLOADING} otherwise + */ + @Override + public int getStatus() { + int status = (isFailed()) ? STATUS_FAILED : STATUS_UPLOADING; + return status; + } + public void setSlot(HttpUploadSlot slot) { this.slot = slot; } |