From: David A. Velasco Date: Fri, 20 Jul 2012 11:30:04 +0000 (+0200) Subject: Handling of PUT response code fixed X-Git-Tag: oc-android-1.4.3~257 X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/commitdiff_plain/d2f2500bddb2a3809cd8e96a64c091f331b8f274?ds=inline Handling of PUT response code fixed --- diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 212a8063..b113f31e 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -18,7 +18,7 @@ --> + android:versionName="0.1.170B" xmlns:android="http://schemas.android.com/apk/res/android"> diff --git a/src/eu/alefzero/webdav/WebdavClient.java b/src/eu/alefzero/webdav/WebdavClient.java index a5398000..150f9b89 100644 --- a/src/eu/alefzero/webdav/WebdavClient.java +++ b/src/eu/alefzero/webdav/WebdavClient.java @@ -186,7 +186,7 @@ public class WebdavClient extends HttpClient { */ public boolean putFile(String localFile, String remoteTarget, String contentType) { - boolean result = true; + boolean result = false; try { Log.e("ASD", contentType + ""); @@ -200,7 +200,11 @@ public class WebdavClient extends HttpClient { int status = executeMethod(put, 0); Log.d(TAG, "PUT method return with status " + status); - Log.i(TAG, "Uploading, done"); + if (status == HttpStatus.SC_OK || status == HttpStatus.SC_CREATED || status == HttpStatus.SC_NO_CONTENT) { + result = true; + Log.i(TAG, "Uploading, done"); + } + } catch (final Exception e) { Log.i(TAG, "" + e.getMessage()); result = false;