aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/entities/FileParams.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/entities/FileParams.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/entities/FileParams.java44
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;
+ }
}