Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…a-sdk into video-upload
  • Loading branch information
akki744 committed Apr 4, 2019
2 parents e2258b8 + e5b8820 commit eebc627
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Lib/src/com/froala/editor/S3.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public final static Map<Object, Object> getHash(S3Config config) throws Exceptio

String dateString = dt.format(now);

String credential = String.join("/", new String[] { accessKey, dateString, region, "s3/aws4_request" });
String credential = Utils.join("/", new String[] { accessKey, dateString, region, "s3/aws4_request" });
String xAmzDate = dateString + "T000000Z";

SimpleDateFormat isoDt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.000'Z'");
Expand Down
13 changes: 13 additions & 0 deletions Lib/src/com/froala/editor/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,17 @@ public static byte[] hmac(byte[] key, String data) throws Exception {
public static String hmac_hex(byte[] key, String data) throws Exception {
return new String(Hex.encodeHex(hmac(key, data)));
}

public static String join(String delimiter, String[] elements) {
String res = "";

for(int i = 0; i < elements.length; i++) {
if(i > 0) {
res += delimiter;
}
res += elements[i];
}

return res;
}
}

0 comments on commit eebc627

Please sign in to comment.