diff --git a/Examples/src/com/froala/examples/servlets/UploadImage.java b/Examples/src/com/froala/examples/servlets/UploadImage.java index 74a9176..2c98a7c 100644 --- a/Examples/src/com/froala/examples/servlets/UploadImage.java +++ b/Examples/src/com/froala/examples/servlets/UploadImage.java @@ -49,11 +49,11 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) responseData = new HashMap(); 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"); diff --git a/Examples/src/com/froala/examples/servlets/UploadVideo.java b/Examples/src/com/froala/examples/servlets/UploadVideo.java index ad9e345..4d182bc 100644 --- a/Examples/src/com/froala/examples/servlets/UploadVideo.java +++ b/Examples/src/com/froala/examples/servlets/UploadVideo.java @@ -49,11 +49,11 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) responseData = new HashMap(); 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"); diff --git a/Lib/src/com/froala/editor/S3.java b/Lib/src/com/froala/editor/S3.java index 14b0424..212d70f 100644 --- a/Lib/src/com/froala/editor/S3.java +++ b/Lib/src/com/froala/editor/S3.java @@ -56,7 +56,7 @@ public final static Map 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'"); diff --git a/Lib/src/com/froala/editor/Utils.java b/Lib/src/com/froala/editor/Utils.java index 3cb6a8c..8890891 100644 --- a/Lib/src/com/froala/editor/Utils.java +++ b/Lib/src/com/froala/editor/Utils.java @@ -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; + } }