diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-01-05 21:05:24 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-01-05 21:05:24 +0100 |
commit | c09e7f0a21f563359c69f0e4198c7563cd2d4809 (patch) | |
tree | a52009fa04da58a10bad7de19814e15e010fde7a /src/main/java/de/thedevstack/conversationsplus/entities/FileParams.java | |
parent | 867ee316619f814e6311668d0f2b910cecdd6393 (diff) | |
parent | 2586fe2b9d745c0666656acb6beb4020805dd220 (diff) |
Merge branch 'trz/rebase' into trz/rename
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/entities/FileParams.java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/entities/FileParams.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/entities/FileParams.java b/src/main/java/de/thedevstack/conversationsplus/entities/FileParams.java index bce8e571..7d5741d9 100644 --- a/src/main/java/de/thedevstack/conversationsplus/entities/FileParams.java +++ b/src/main/java/de/thedevstack/conversationsplus/entities/FileParams.java @@ -8,6 +8,7 @@ import de.thedevstack.conversationsplus.utils.MimeUtils; */ public class FileParams { private String name; + private String originalFilename; private String path; private String url; private String mimeType; @@ -15,6 +16,8 @@ public class FileParams { private int width = 0; private int height = 0; private FileStatus fileStatus; + private byte[] aeskey; + private byte[] iv; public FileParams() { fileStatus = FileStatus.UNDEFINED; @@ -88,6 +91,39 @@ public class FileParams { return path; } + public void setKeyAndIv(byte[] keyIvCombo) { + if (null != keyIvCombo) { + if (keyIvCombo.length == 48) { + this.aeskey = new byte[32]; + this.iv = new byte[16]; + System.arraycopy(keyIvCombo, 0, this.iv, 0, 16); + System.arraycopy(keyIvCombo, 16, this.aeskey, 0, 32); + } else if (keyIvCombo.length >= 32) { + this.aeskey = new byte[32]; + System.arraycopy(keyIvCombo, 0, aeskey, 0, 32); + } else if (keyIvCombo.length >= 16) { + this.aeskey = new byte[16]; + System.arraycopy(keyIvCombo, 0, this.aeskey, 0, 16); + } + } + } + + public void setKey(byte[] key) { + this.aeskey = key; + } + + public void setIv(byte[] iv) { + this.iv = iv; + } + + public byte[] getKey() { + return this.aeskey; + } + + public byte[] getIv() { + return this.iv; + } + /** * Sets the path to the file. * If no file name is stored yet here - this method tries to extract the file name from the path. @@ -126,4 +162,12 @@ public class FileParams { public FileStatus getFileStatus() { return this.fileStatus; } + + public void setOriginalFilename(String originalFilename) { + this.originalFilename = originalFilename; + } + + public String getOriginalFilename() { + return this.originalFilename; + } } |