/// <exception cref="System.UriFormatException"></exception> private void PushDocumentToSyncGateway(string docId, string docJson) { // push a document to server Uri replicationUrlTrailingDoc1 = new Uri(string.Format("%s/%s", GetReplicationURL ().ToExternalForm(), docId)); Uri pathToDoc1 = new Uri(replicationUrlTrailingDoc1, docId); Log.D(Tag, "Send http request to " + pathToDoc1); CountDownLatch httpRequestDoneSignal = new CountDownLatch(1); BackgroundTask getDocTask = new _BackgroundTask_139(pathToDoc1, docJson, httpRequestDoneSignal ); getDocTask.Execute(); Log.D(Tag, "Waiting for http request to finish"); try { httpRequestDoneSignal.Await(300, TimeUnit.Seconds); Log.D(Tag, "http request finished"); } catch (Exception e) { Sharpen.Runtime.PrintStackTrace(e); } }
/// <exception cref="System.UriFormatException"></exception> private void PushDocumentToSyncGateway(string docId, string docJson) { // push a document to server Uri replicationUrlTrailingDoc1 = new Uri(string.Format("%s/%s", GetReplicationURL ().ToExternalForm(), docId)); Uri pathToDoc1 = new Uri(replicationUrlTrailingDoc1, docId); Log.D(Tag, "Send http request to " + pathToDoc1); CountDownLatch httpRequestDoneSignal = new CountDownLatch(1); BackgroundTask getDocTask = new _BackgroundTask_139(pathToDoc1, docJson, httpRequestDoneSignal ); getDocTask.Execute(); Log.D(Tag, "Waiting for http request to finish"); try { httpRequestDoneSignal.Await(300, TimeUnit.Seconds); Log.D(Tag, "http request finished"); } catch (Exception e) { Sharpen.Runtime.PrintStackTrace(e); } }