diff options
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferEntity.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferEntity.java b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferEntity.java index e1b40fa6..06e697db 100644 --- a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferEntity.java +++ b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/FileTransferEntity.java @@ -49,10 +49,16 @@ public class FileTransferEntity implements Transferable { * This initialization includes loading the file and associating this transferable to the message. * @param message the message in which the file to transfer is contained. */ - public FileTransferEntity(Message message) { + public FileTransferEntity(Message message, boolean initFile) { this.message = message; this.message.setTransferable(this); - this.file = FileBackend.getFile(message, false); + if (initFile) { + this.initFile(); + } + } + + protected final void initFile() { + this.file = FileBackend.getFile(this.message, false); } /** @@ -68,11 +74,11 @@ public class FileTransferEntity implements Transferable { /** * Returns the global transferable status. * - * @return {@value STATUS_FAILED} if #isFailed returns <code>true</code>, {@value STATUS_UPLOADING} otherwise + * @return {@value STATUS_FAILED} if #isFailed returns <code>true</code>, {@value STATUS_UNKNOWN} otherwise */ @Override public int getStatus() { - int status = (isFailed()) ? STATUS_FAILED : STATUS_UPLOADING; + int status = (isFailed()) ? STATUS_FAILED : STATUS_UNKNOWN; return status; } @@ -80,7 +86,6 @@ public class FileTransferEntity implements Transferable { * Returns the expected file size of the underlying file. * @return the expected file size or 0 if no file is associated. */ - @Override public long getFileSize() { return file == null ? 0 : file.getExpectedSize(); } |