Skip to content

Commit ce83d63

Browse files
Add support for replyAll packages and file uploaded timestamp
1 parent cea22d1 commit ce83d63

File tree

9 files changed

+70
-2
lines changed

9 files changed

+70
-2
lines changed

SendSafelyAPI/src/com/sendsafely/BasePackage.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class BasePackage {
3030
private Date packageTimestamp;
3131
private String packageOwner = "";
3232
private String packageParentId;
33+
private boolean allowReplyAll;
3334

3435
/**
3536
* @returnType String
@@ -273,4 +274,11 @@ public void setPackageParentId(String packageParentId) {
273274
this.packageParentId = packageParentId;
274275
}
275276

277+
public boolean isAllowReplyAll() {
278+
return allowReplyAll;
279+
}
280+
281+
public void setAllowReplyAll(boolean allowReplyAll) {
282+
this.allowReplyAll = allowReplyAll;
283+
}
276284
}

SendSafelyAPI/src/com/sendsafely/File.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.sendsafely;
22

3+
import java.util.Date;
4+
35
/**
46
* A Java Bean containing information about a file.
57
* Only the Getters should be used from this object, since the server will populate the object.
@@ -13,6 +15,7 @@ public class File {
1315
private long fileSize;
1416
//private String createdBy;
1517
private int parts;
18+
private Date fileUploaded;
1619

1720
public File(String fileId, String fileName, long fileSize, int parts){
1821
this.fileId = fileId;
@@ -101,5 +104,15 @@ public int getParts() {
101104
public void setParts(int parts) {
102105
this.parts = parts;
103106
}
107+
108+
public Date getFileUploaded() {
109+
return fileUploaded;
110+
}
111+
112+
public void setFileUploaded(Date fileUploaded) {
113+
this.fileUploaded = fileUploaded;
114+
}
115+
116+
104117

105118
}

SendSafelyAPI/src/com/sendsafely/SendSafely.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,25 @@ public PackageURL finalizePackage(String packageId, String keycode) throws Limit
680680
return handler.makeRequest(packageId, keycode);
681681
}
682682

683+
/**
684+
* @description Finalizes the package so it can be delivered to the recipients.
685+
* @param packageId The unique package id of the package to be finalized.
686+
* @param keycode The keycode belonging to the package.
687+
* @param notify A boolean flag indicating whether SendSafely should send the secure link to the package recipients
688+
* @param allowReplyAll A boolean flag that when set to true will allow recipients to reply to the package sender and all other recipients on the package. By default, SendSafely only allows replying to the package sender.
689+
* @returnType PackageURL
690+
* @return A link to access the package. This link can be sent to the recipients.
691+
* @throws LimitExceededException
692+
* @throws FinalizePackageFailedException
693+
* @throws ApproverRequiredException
694+
*/
695+
public PackageURL finalizePackage(String packageId, String keycode, boolean notify, boolean allowReplyAll) throws LimitExceededException, FinalizePackageFailedException, ApproverRequiredException
696+
{
697+
FinalizePackageHandler handler = (FinalizePackageHandler)HandlerFactory.getInstance(uploadManager, Endpoint.FINALIZE_PACKAGE);
698+
handler.setNotify(notify);
699+
return handler.setRequestAllowReplyAll(allowReplyAll).makeRequest(packageId, keycode);
700+
}
701+
683702
/**
684703
* @description Finalizes the package so it can be delivered to the recipients.
685704
* @param packageId The unique package id of the package to be finalized.

SendSafelyAPI/src/com/sendsafely/dto/request/FinalizePackageRequest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,8 @@ public void setUndisclosedRecipients(boolean undisclosedRecipients) {
3131
super.setPostParam("undisclosedRecipients", undisclosedRecipients);
3232
}
3333

34+
public void setAllowReplyAll(boolean allowReplyAll) {
35+
super.setPostParam("allowReplyAll", allowReplyAll);
36+
}
37+
3438
}

SendSafelyAPI/src/com/sendsafely/dto/response/FileResponse.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package com.sendsafely.dto.response;
22

3+
import java.util.Date;
4+
35
public class FileResponse {
46

57
private String fileId;
68
private String fileName;
79
private long fileSize;
810
private String createdByEmail;
911
private int parts;
12+
private Date fileUploaded;
13+
private String fileUploadedStr;
1014

1115
public String getFileId() {
1216
return fileId;
@@ -38,6 +42,10 @@ public int getParts() {
3842
public void setParts(int parts) {
3943
this.parts = parts;
4044
}
41-
42-
45+
public Date getFileUploaded() {
46+
return fileUploaded;
47+
}
48+
public String getFileUploadedStr() {
49+
return fileUploadedStr;
50+
}
4351
}

SendSafelyAPI/src/com/sendsafely/dto/response/PackageInformationResponse.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public class PackageInformationResponse extends BaseResponse {
2828
private Date packageTimestamp;
2929
private String packageSender;
3030
private String packageParentId;
31+
private boolean allowReplyAll;
3132

3233
public List<RecipientResponse> getRecipients() {
3334
return recipients;
@@ -150,4 +151,11 @@ public String getPackageParentId() {
150151
public void setPackageParentId(String packageParentId) {
151152
this.packageParentId = packageParentId;
152153
}
154+
public boolean isAllowReplyAll() {
155+
return allowReplyAll;
156+
}
157+
public void setAllowReplyAll(boolean allowReplyAll) {
158+
this.allowReplyAll = allowReplyAll;
159+
}
160+
153161
}

SendSafelyAPI/src/com/sendsafely/handlers/FinalizePackageHandler.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,9 @@ public void setNotify(boolean notify) {
185185
this.notify = notify;
186186
}
187187

188+
public FinalizePackageHandler setRequestAllowReplyAll(boolean allowReplyAll) {
189+
request.setAllowReplyAll(allowReplyAll);
190+
return this;
191+
}
192+
188193
}

SendSafelyAPI/src/com/sendsafely/handlers/GetDirectoryHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ private List<File> convert(List<FileResponse> files) {
6161
newFile.setFileName(resp.getFileName());
6262
newFile.setFileSize(resp.getFileSize());
6363
newFile.setParts(resp.getParts());
64+
newFile.setFileUploaded(resp.getFileUploaded());
6465
fileList.add(newFile);
6566
}
6667
return fileList;

SendSafelyAPI/src/com/sendsafely/handlers/PackageInformationHandler.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ protected Package convert(PackageInformationResponse obj)
8989
info.setPackageTimestamp(obj.getPackageTimestamp());
9090
info.setPackageOwner(obj.getPackageSender());
9191
info.setPackageParentId(obj.getPackageParentId());
92+
info.setAllowReplyAll(obj.isAllowReplyAll());
9293
return info;
9394
}
9495

@@ -127,6 +128,7 @@ protected File createFile(FileResponse resp)
127128
f.setFileName(resp.getFileName());
128129
f.setFileSize(resp.getFileSize());
129130
f.setParts(resp.getParts());
131+
f.setFileUploaded(resp.getFileUploaded());
130132
return f;
131133
}
132134

0 commit comments

Comments
 (0)