Skip to content

Commit

Permalink
Merge pull request #3 from akki744/video-upload
Browse files Browse the repository at this point in the history
Increase image/video upload load time to 10 secs
  • Loading branch information
dheerajaccolite authored Apr 4, 2019
2 parents 345a944 + eebc627 commit b447aa9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Examples/src/com/froala/examples/servlets/UploadImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
responseData = new HashMap<Object, Object>();
responseData.put("error", e.toString());
}
// Wait for 5 secs for image upload
// Wait for 10 secs for image upload
synchronized (responseData) {
try
{
responseData.wait(5000);
responseData.wait(10000);
String jsonResponseData = new Gson().toJson(responseData);
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
Expand Down
4 changes: 2 additions & 2 deletions Examples/src/com/froala/examples/servlets/UploadVideo.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
responseData = new HashMap<Object, Object>();
responseData.put("error", e.toString());
}
// Wait for 5 secs for video upload
// Wait for 10 secs for video upload
synchronized (responseData) {
try
{
responseData.wait(5000);
responseData.wait(10000);
String jsonResponseData = new Gson().toJson(responseData);
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
Expand Down
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 b447aa9

Please sign in to comment.