Skip to content

Commit 66cb41c

Browse files
v3.1.7
- Remove JDK8 dependency - Fix filename bug in DownloadAndDecryptFileHander
1 parent a9b9458 commit 66cb41c

File tree

7 files changed

+26
-15
lines changed

7 files changed

+26
-15
lines changed

SendSafelyAPI/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Use the following dependency in your project to grab via Maven:
66
<dependency>
77
<groupId>com.sendsafely</groupId>
88
<artifactId>sendsafely-java-api</artifactId>
9-
<version>3.1.6</version>
9+
<version>3.1.7</version>
1010
</dependency>
1111
```
1212

13-
Refer to the SendSafely [Java-Client-API/SampleApplication](https://github.com/SendSafely/Java-Client-API/tree/master/SampleApplication) for a quick start with using the Java Client API.
13+
Refer to the SendSafely [Java-Client-API/SampleApplication](https://github.com/SendSafely/Java-Client-API/tree/master/SampleApplication) for a quick start with using the Java Client API.

SendSafelyAPI/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma
66

77
<groupId>com.sendsafely</groupId>
88
<artifactId>sendsafely-java-api</artifactId>
9-
<version>3.1.6</version>
9+
<version>3.1.7</version>
1010
<packaging>jar</packaging>
1111

1212
<name>SendSafely Java Client API</name>

SendSafelyAPI/src/com/sendsafely/BasePackage.java

+9
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,19 @@ public void setPackageParentId(String packageParentId) {
274274
this.packageParentId = packageParentId;
275275
}
276276

277+
/**
278+
* @description Returns boolean flag if the allowReplyAll flag is set on the package.
279+
* @returnType boolean
280+
* @return Flag representing the value of allow reply all.
281+
*/
277282
public boolean isAllowReplyAll() {
278283
return allowReplyAll;
279284
}
280285

286+
/**
287+
* @description Set internally by the API.
288+
* @param allowReplyAll
289+
*/
281290
public void setAllowReplyAll(boolean allowReplyAll) {
282291
this.allowReplyAll = allowReplyAll;
283292
}

SendSafelyAPI/src/com/sendsafely/File.java

+9
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,19 @@ public void setParts(int parts) {
105105
this.parts = parts;
106106
}
107107

108+
/**
109+
* @description Returns the Date object representing when the file was uploaded
110+
* @returnType Date
111+
* @return A Date representing when the file was upload
112+
*/
108113
public Date getFileUploaded() {
109114
return fileUploaded;
110115
}
111116

117+
/**
118+
* @description Set internally by the API.
119+
* @param fileUploaded
120+
*/
112121
public void setFileUploaded(Date fileUploaded) {
113122
this.fileUploaded = fileUploaded;
114123
}

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

-7
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33
import java.io.IOException;
44
import java.util.ArrayList;
55

6-
import javax.xml.bind.DatatypeConverter;
7-
8-
import org.bouncycastle.util.encoders.Base64Encoder;
9-
import org.bouncycastle.util.encoders.UrlBase64;
10-
import org.bouncycastle.util.encoders.UrlBase64Encoder;
11-
126
import com.sendsafely.ContactGroup;
137
import com.sendsafely.File;
148
import com.sendsafely.Package;
@@ -17,7 +11,6 @@
1711
import com.sendsafely.dto.response.CreatePackageResponse;
1812
import com.sendsafely.enums.APIResponse;
1913
import com.sendsafely.enums.Endpoint;
20-
import com.sendsafely.enums.HTTPMethod;
2114
import com.sendsafely.exceptions.CreatePackageFailedException;
2215
import com.sendsafely.exceptions.LimitExceededException;
2316
import com.sendsafely.exceptions.PackageInformationFailedException;

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -348,10 +348,10 @@ private OutputStream getOutputStream(java.io.File newFile) throws DownloadFileEx
348348
}
349349
}
350350

351-
private java.io.File createTempFile(File file) throws DownloadFileException
352-
{
351+
private java.io.File createTempFile(File file) throws DownloadFileException {
352+
String filename = file.getFileName().replaceAll("[<>:\"/\\\\|?*]", "_");
353353
try {
354-
return java.io.File.createTempFile(file.getFileName(), "");
354+
return java.io.File.createTempFile(filename, "");
355355
} catch (IOException e) {
356356
throw new DownloadFileException(e);
357357
}

SendSafelyAPI/src/com/sendsafely/utils/CryptoUtil.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import javax.crypto.Mac;
2020
import javax.crypto.spec.SecretKeySpec;
21-
import javax.xml.bind.DatatypeConverter;
2221

2322
import org.bouncycastle.bcpg.ArmoredOutputStream;
2423
import org.bouncycastle.crypto.AsymmetricCipherKeyPair;
@@ -101,7 +100,8 @@ public static String Sign(String key, String dataToSign) throws SignatureCreatio
101100
byte[] rawHmac = mac.doFinal(dataToSign.getBytes());
102101

103102
// Hex encode and return
104-
return DatatypeConverter.printHexBinary(rawHmac);
103+
104+
return Hex.toHexString(rawHmac);
105105
}
106106

107107
public static String GenerateKeyCode() throws TokenGenerationFailedException

0 commit comments

Comments
 (0)