aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2018-05-05 20:28:04 +0200
committersteckbrief <steckbrief@chefmail.de>2018-05-05 20:28:04 +0200
commitb0780224b5bdd68d74ef514e64e14ce9d37d7b90 (patch)
tree04311ea20090216b4897bcb507d79c7e02f76eae /src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java
parent853f50e43f68599774469dd12240f35800144991 (diff)
introduces new message state model
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java
index 1313bcca..62c1af59 100644
--- a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java
+++ b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java
@@ -10,6 +10,7 @@ import de.thedevstack.conversationsplus.http.Http;
import de.thedevstack.conversationsplus.http.HttpClient;
import de.thedevstack.conversationsplus.http.HttpHeadRetrievedListener;
import de.thedevstack.conversationsplus.persistance.DatabaseBackend;
+import de.thedevstack.conversationsplus.utils.MessageParserUtil;
import de.thedevstack.conversationsplus.utils.MessageUtil;
import de.thedevstack.conversationsplus.utils.UiUpdateHelper;
import okhttp3.Call;
@@ -36,12 +37,11 @@ public class HttpRetrieveHead implements Http, Callback {
* If this code is reached and the URL is null something went wrong.
* Try again to extract the file parameters from the message.
*/
- MessageUtil.extractFileParamsFromBody(message);
+ MessageParserUtil.extractFileParamsFromBody(message);
this.url = (null != message.getFileParams()) ? message.getFileParams().getUrl() : null;
if (null == this.url) {
- message.setTreatAsDownloadable(Message.Decision.NEVER); // TODO find sth better
if (null != message.getFileParams()) {
- MessageUtil.setAndSaveFileStatus(message, FileStatus.UNDEFINED);
+ MessageUtil.setAndSaveFileStatus(message, FileStatus.NOT_FOUND);
}
}
}
@@ -89,7 +89,7 @@ public class HttpRetrieveHead implements Http, Callback {
fileParams.setSize(size);
fileParams.setMimeType(contentType);
if (0 < size) {
- fileParams.setFileStatus(FileStatus.NEEDS_DOWNLOAD);
+ MessageUtil.setFileStatus(message, FileStatus.NEEDS_DOWNLOAD);
}
DatabaseBackend.getInstance().updateMessage(message);
UiUpdateHelper.updateConversationUi();