Skip to content

Commit 20ac376

Browse files
Merge pull request #4 from SendSafely/v3.0.2
Updates for v3.0.2 release
2 parents 999443d + a581155 commit 20ac376

File tree

5 files changed

+53
-13
lines changed

5 files changed

+53
-13
lines changed

SendSafelyAPI/src/com/sendsafely/Privatekey.java

+3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ public class Privatekey {
88
public String getArmoredKey() {
99
return privateKey;
1010
}
11+
1112
public void setArmoredKey(String privateKey) {
1213
this.privateKey = privateKey;
1314
}
15+
1416
public String getPublicKeyId() {
1517
return publicKeyId;
1618
}
19+
1720
public void setPublicKeyId(String publicKeyId) {
1821
this.publicKeyId = publicKeyId;
1922
}

SendSafelyAPI/src/com/sendsafely/SendSafely.java

+20-11
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,12 @@ public java.io.File downloadFile(String packageId, String fileId, String keyCode
455455
return handler.makeRequest(packageId, null, fileId, keyCode, progress, null);
456456
}
457457

458-
/*
459-
* @ description Gets a list of Recipient History information.
460-
* @ param recipientEmail
461-
* @ returnType List<RecipientHistory>
462-
* @ return a List<RecipientHistory> object containing a list of all recipient history items.
463-
* @ throws RecipientFailedException
458+
/**
459+
* @description Retrieves a list of packages where the passed in email address is a package recipient.
460+
* @param recipientEmail The email address of the recipient.
461+
* @returnType List<RecipientHistory>
462+
* @return A List<RecipientHistory> containing information about each package retrieved, including confirmed downloads for the recipient.
463+
* @throws RecipientFailedException
464464
*/
465465
public List<RecipientHistory> getRecipientHistory(String recipientEmail) throws RecipientFailedException{
466466
GetRecipientHistoryHandler handler = ((GetRecipientHistoryHandler)HandlerFactory.getInstance(uploadManager, Endpoint.RECIPIENT_HISTORY));
@@ -568,8 +568,8 @@ public File encryptAndUploadFile(String packageId, String keyCode, FileManager f
568568
}
569569

570570
/**
571-
* @description Deletes a package given a package ID.
572-
* @param packageId The unique package id of the package for the delete temporary package operation.
571+
* @description Deletes a temporary package, which is a package that has not yet been finalized.
572+
* @param packageId The unique package id of the package to be deleted.
573573
* @throws DeletePackageException
574574
*/
575575
public void deleteTempPackage(String packageId) throws DeletePackageException
@@ -598,8 +598,9 @@ public File encryptAndUploadFile(String packageId, String keyCode, String server
598598
}
599599

600600
/**
601-
* @description Get all received packages
602-
* @return List<String> a list of all received package IDs.
601+
* @description Retrieves a list of all active packages received for the given API User.
602+
* @return A List<PackageReference> containing package metadata for all received packages.
603+
* @returnType List<PackageReference>
603604
* @throws GetPackagesException
604605
*/
605606
public List<PackageReference> getReceivedPackages() throws GetPackagesException
@@ -892,7 +893,7 @@ public EnterpriseInfo getEnterpriseInfo() throws EnterpriseInfoFailedException
892893
}
893894

894895
/**
895-
* @description Generates a new RSA Key pair used to encrypt keycodes. The private key as well as an identifier associating the public Key is returned to the user. The public key is uploaded and stored on the SendSafely servers.
896+
* @description Generates a new RSA Key pair used to encrypt keycodes. The private key as well as an identifier associating the public Key is returned to the user. The public key is uploaded and stored on the SendSafely servers.
896897
* @param description The description used for generating the key pair.
897898
* @returnType Privatekey
898899
* @return Returns a Private Key containing the armored private key and a Public Key ID associating a public key to the private key.
@@ -912,6 +913,14 @@ public Privatekey generateKeyPair(String description) throws NoSuchAlgorithmExce
912913
return privateKey;
913914
}
914915

916+
/**
917+
* @description Downloads and decrypts a keycode from the server for a given packageId and RSA Key pair.
918+
* @param packageId The package id for the keycode.
919+
* @param privateKey The private key associated with the RSA Key pair used to encrypt the package keycode.
920+
* @return Returns the decrypted keycode.
921+
* @returnType String
922+
* @throws GetKeycodeFailedException
923+
*/
915924
public String getKeycode(String packageId, Privatekey privateKey) throws GetKeycodeFailedException{
916925
GetKeycode handler = new GetKeycode(uploadManager);
917926
return handler.get(packageId, privateKey);

SendSafelyAPI/src/com/sendsafely/dto/RecipientHistory.java

+28
Original file line numberDiff line numberDiff line change
@@ -21,87 +21,115 @@ public class RecipientHistory {
2121
private Recipient packageRecipientResponse;
2222
private Set<String> filenames;
2323
private boolean packageContainsMessage;
24+
2425
public String getPackageId() {
2526
return packageId;
2627
}
28+
2729
public void setPackageId(String packageId) {
2830
this.packageId = packageId;
2931
}
32+
3033
public String getPackageUserName() {
3134
return packageUserName;
3235
}
36+
3337
public void setPackageUserName(String packageUserName) {
3438
this.packageUserName = packageUserName;
3539
}
40+
3641
public String getPackageUserId() {
3742
return packageUserId;
3843
}
44+
3945
public void setPackageUserId(String packageUserId) {
4046
this.packageUserId = packageUserId;
4147
}
48+
4249
public int getPackageState() {
4350
return packageState;
4451
}
52+
4553
public void setPackageState(int packageState) {
4654
this.packageState = packageState;
4755
}
56+
4857
public String getPackageStateStr() {
4958
return packageStateStr;
5059
}
60+
5161
public void setPackageStateStr(String packageStateStr) {
5262
this.packageStateStr = packageStateStr;
5363
}
64+
5465
public String getPackageStateColor() {
5566
return packageStateColor;
5667
}
68+
5769
public void setPackageStateColor(String packageStateColor) {
5870
this.packageStateColor = packageStateColor;
5971
}
72+
6073
public int getPackageLife() {
6174
return packageLife;
6275
}
76+
6377
public void setPackageLife(int packageLife) {
6478
this.packageLife = packageLife;
6579
}
80+
6681
public String getPackageUpdateTimestampStr() {
6782
return packageUpdateTimestampStr;
6883
}
84+
6985
public void setPackageUpdateTimestampStr(String packageUpdateTimestampStr) {
7086
this.packageUpdateTimestampStr = packageUpdateTimestampStr;
7187
}
88+
7289
public Date getPackageUpdateTimestamp() {
7390
return packageUpdateTimestamp;
7491
}
92+
7593
public void setPackageUpdateTimestamp(Date packageUpdateTimestamp) {
7694
this.packageUpdateTimestamp = packageUpdateTimestamp;
7795
}
96+
7897
public String getPackageCode() {
7998
return packageCode;
8099
}
100+
81101
public void setPackageCode(String packageCode) {
82102
this.packageCode = packageCode;
83103
}
104+
84105
public String getPackageOS() {
85106
return packageOS;
86107
}
108+
87109
public void setPackageOS(String packageOS) {
88110
this.packageOS = packageOS;
89111
}
112+
90113
public Recipient getPackageRecipientResponse() {
91114
return packageRecipientResponse;
92115
}
116+
93117
public void setPackageRecipientResponse(Recipient packageRecipientResponse) {
94118
this.packageRecipientResponse = packageRecipientResponse;
95119
}
120+
96121
public Set<String> getFilenames() {
97122
return filenames;
98123
}
124+
99125
public void setFilenames(Set<String> filenames) {
100126
this.filenames = filenames;
101127
}
128+
102129
public boolean isPackageContainsMessage() {
103130
return packageContainsMessage;
104131
}
132+
105133
public void setPackageContainsMessage(boolean packageContainsMessage) {
106134
this.packageContainsMessage = packageContainsMessage;
107135
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public GetOrganizationPackagesHandler(UploadManager uploadManager) {
3232
public PackageSearchResults makeRequest(Date fromDate, Date toDate, String sender, PackageStatus status,
3333
String recipient, String fileName) throws GetPackagesException {
3434
//Convert Date to String to pass to server.
35-
SimpleDateFormat outputDateFormat = new SimpleDateFormat("MM/dd/YYYY");
35+
SimpleDateFormat outputDateFormat = new SimpleDateFormat("MM/dd/yyyy");
3636
String fromDateStr = fromDate==null?"":outputDateFormat.format(fromDate);
3737
String toDateStr = toDate==null?"":outputDateFormat.format(toDate);
3838
request.setFromDate(fromDateStr);

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
public class ParseLinksHandler
99
{
10-
private final String REGEX = "(https:\\/\\/[a-zA-Z\\.]+\\/receive\\/\\?[A-Za-z0-9&=\\-]+packageCode=[A-Za-z0-9\\-_]+#keyCode=[A-Za-z0-9\\-_]+)";
10+
private final String REGEX = "(https:\\/\\/[a-zA-Z\\.-]+\\/receive\\/\\?[A-Za-z0-9&=\\-]+packageCode=[A-Za-z0-9\\-_]+#keyCode=[A-Za-z0-9\\-_]+)";
1111

1212
public List<String> parse(String text) {
1313
List<String> links = new ArrayList<String>();

0 commit comments

Comments
 (0)