X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/53b67429ea8c97b83602cec3446a10e0b6b7ff5e..d33f4791497b7fa59fba92df8c71dfc5989d52b2:/src/eu/alefzero/webdav/WebdavClient.java diff --git a/src/eu/alefzero/webdav/WebdavClient.java b/src/eu/alefzero/webdav/WebdavClient.java index 2e3ef874..df30dcb6 100644 --- a/src/eu/alefzero/webdav/WebdavClient.java +++ b/src/eu/alefzero/webdav/WebdavClient.java @@ -1,9 +1,10 @@ /* ownCloud Android client application * Copyright (C) 2011 Bartek Przybylski + * Copyright (C) 2012-2013 ownCloud Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or + * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -22,7 +23,6 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; -import java.util.Random; import org.apache.commons.httpclient.Credentials; import org.apache.commons.httpclient.HttpClient; @@ -99,15 +99,15 @@ public class WebdavClient extends HttpClient { int readResult; while ((readResult = bis.read(bytes)) != -1) { if (mDataTransferListener != null) - mDataTransferListener.transferProgress(readResult); + mDataTransferListener.onTransferProgress(readResult); fos.write(bytes, 0, readResult); } + fos.close(); ret = true; } else { exhaustResponse(get.getResponseBodyAsStream()); } Log.e(TAG, "Download of " + remoteFilePath + " to " + targetFile + " finished with HTTP status " + status + (!ret?"(FAIL)":"")); - } catch (Exception e) { logException(e, "dowloading " + remoteFilePath); @@ -166,7 +166,7 @@ public class WebdavClient extends HttpClient { try { File f = new File(localFile); FileRequestEntity entity = new FileRequestEntity(f, contentType); - entity.setOnDatatransferProgressListener(mDataTransferListener); + entity.addDatatransferProgressListener(mDataTransferListener); put.setRequestEntity(entity); status = executeMethod(put); @@ -337,5 +337,5 @@ public class WebdavClient extends HttpClient { public Uri getBaseUri() { return mUri; } - + }