Skip to content

Commit

Permalink
v3.1.7
Browse files Browse the repository at this point in the history
- Remove JDK8 dependency
- Fix filename bug in DownloadAndDecryptFileHander
  • Loading branch information
SendSafely-GitHub committed Dec 9, 2020
1 parent a9b9458 commit 66cb41c
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 15 deletions.
4 changes: 2 additions & 2 deletions SendSafelyAPI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Use the following dependency in your project to grab via Maven:
<dependency>
<groupId>com.sendsafely</groupId>
<artifactId>sendsafely-java-api</artifactId>
<version>3.1.6</version>
<version>3.1.7</version>
</dependency>
```

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.
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.
2 changes: 1 addition & 1 deletion SendSafelyAPI/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/ma

<groupId>com.sendsafely</groupId>
<artifactId>sendsafely-java-api</artifactId>
<version>3.1.6</version>
<version>3.1.7</version>
<packaging>jar</packaging>

<name>SendSafely Java Client API</name>
Expand Down
9 changes: 9 additions & 0 deletions SendSafelyAPI/src/com/sendsafely/BasePackage.java
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,19 @@ public void setPackageParentId(String packageParentId) {
this.packageParentId = packageParentId;
}

/**
* @description Returns boolean flag if the allowReplyAll flag is set on the package.
* @returnType boolean
* @return Flag representing the value of allow reply all.
*/
public boolean isAllowReplyAll() {
return allowReplyAll;
}

/**
* @description Set internally by the API.
* @param allowReplyAll
*/
public void setAllowReplyAll(boolean allowReplyAll) {
this.allowReplyAll = allowReplyAll;
}
Expand Down
9 changes: 9 additions & 0 deletions SendSafelyAPI/src/com/sendsafely/File.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,19 @@ public void setParts(int parts) {
this.parts = parts;
}

/**
* @description Returns the Date object representing when the file was uploaded
* @returnType Date
* @return A Date representing when the file was upload
*/
public Date getFileUploaded() {
return fileUploaded;
}

/**
* @description Set internally by the API.
* @param fileUploaded
*/
public void setFileUploaded(Date fileUploaded) {
this.fileUploaded = fileUploaded;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
import java.io.IOException;
import java.util.ArrayList;

import javax.xml.bind.DatatypeConverter;

import org.bouncycastle.util.encoders.Base64Encoder;
import org.bouncycastle.util.encoders.UrlBase64;
import org.bouncycastle.util.encoders.UrlBase64Encoder;

import com.sendsafely.ContactGroup;
import com.sendsafely.File;
import com.sendsafely.Package;
Expand All @@ -17,7 +11,6 @@
import com.sendsafely.dto.response.CreatePackageResponse;
import com.sendsafely.enums.APIResponse;
import com.sendsafely.enums.Endpoint;
import com.sendsafely.enums.HTTPMethod;
import com.sendsafely.exceptions.CreatePackageFailedException;
import com.sendsafely.exceptions.LimitExceededException;
import com.sendsafely.exceptions.PackageInformationFailedException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,10 @@ private OutputStream getOutputStream(java.io.File newFile) throws DownloadFileEx
}
}

private java.io.File createTempFile(File file) throws DownloadFileException
{
private java.io.File createTempFile(File file) throws DownloadFileException {
String filename = file.getFileName().replaceAll("[<>:\"/\\\\|?*]", "_");
try {
return java.io.File.createTempFile(file.getFileName(), "");
return java.io.File.createTempFile(filename, "");
} catch (IOException e) {
throw new DownloadFileException(e);
}
Expand Down
4 changes: 2 additions & 2 deletions SendSafelyAPI/src/com/sendsafely/utils/CryptoUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import javax.xml.bind.DatatypeConverter;

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

// Hex encode and return
return DatatypeConverter.printHexBinary(rawHmac);

return Hex.toHexString(rawHmac);
}

public static String GenerateKeyCode() throws TokenGenerationFailedException
Expand Down

0 comments on commit 66cb41c

Please sign in to comment.