summaryrefslogtreecommitdiffstats
path: root/core/tests
diff options
context:
space:
mode:
authorTsu Chiang Chuang <tsu@google.com>2011-09-19 10:58:11 -0700
committerTsu Chiang Chuang <tsu@google.com>2011-09-19 10:58:11 -0700
commit5c488ef99726f3e09167f06fa466cf7836f87e18 (patch)
treec65837dcb19f2b2e6439aa97cebfa3ad8f2d313d /core/tests
parent3a423234bcfabf319977bfaa4467a8b8df8d3401 (diff)
downloadframeworks_base-5c488ef99726f3e09167f06fa466cf7836f87e18.zip
frameworks_base-5c488ef99726f3e09167f06fa466cf7836f87e18.tar.gz
frameworks_base-5c488ef99726f3e09167f06fa466cf7836f87e18.tar.bz2
point upload to the correct url.
Change-Id: Ie60c3fb781b1d8cd01b6f09d1666f788e7db6b3a
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/bandwidthtests/src/com/android/bandwidthtest/util/BandwidthTestUtil.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/BandwidthTestUtil.java b/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/BandwidthTestUtil.java
index 7dea9e3..577767c 100644
--- a/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/BandwidthTestUtil.java
+++ b/core/tests/bandwidthtests/src/com/android/bandwidthtest/util/BandwidthTestUtil.java
@@ -117,17 +117,24 @@ public class BandwidthTestUtil {
/**
* Post a given file for a given device and timestamp to the server.
- * @param postUrl {@link String} url used to upload files
+ * @param server {@link String} url of test server
* @param deviceId {@link String} device id that is uploading
* @param timestamp {@link String} timestamp
* @param file {@link File} to upload
* @return true if it succeeded
*/
- public static boolean postFileToServer(String postUrl, String deviceId, String timestamp,
+ public static boolean postFileToServer(String server, String deviceId, String timestamp,
File file) {
try {
+ Log.d(LOG_TAG, "Uploading begining");
HttpClient httpClient = new DefaultHttpClient();
- HttpPost postRequest = new HttpPost(postUrl);
+ String uri = server;
+ if (!uri.endsWith("/")) {
+ uri += "/";
+ }
+ uri += "upload";
+ Log.d(LOG_TAG, "Upload url:" + uri);
+ HttpPost postRequest = new HttpPost(uri);
Part[] parts = {
new StringPart("device_id", deviceId),
new StringPart("timestamp", timestamp),