projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Heavy refactoring: Moved UI things to UI packages
[pub/Android/ownCloud.git]
/
src
/
eu
/
alefzero
/
owncloud
/
WebdavClient.java
diff --git
a/src/eu/alefzero/owncloud/WebdavClient.java
b/src/eu/alefzero/owncloud/WebdavClient.java
index
7ed11ce
..
8459803
100644
(file)
--- a/
src/eu/alefzero/owncloud/WebdavClient.java
+++ b/
src/eu/alefzero/owncloud/WebdavClient.java
@@
-1,9
+1,12
@@
package eu.alefzero.owncloud;
package eu.alefzero.owncloud;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
@@
-78,10
+81,12
@@
public class WebdavClient {
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
return false;
}
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
return false;
}
-
InputStreamReader isr = new InputStreamReader
(response.getEntity().getContent());
+
BufferedInputStream bis = new BufferedInputStream
(response.getEntity().getContent());
FileOutputStream fos = new FileOutputStream(targetPath);
FileOutputStream fos = new FileOutputStream(targetPath);
- int oneByte;
- while ((oneByte = isr.read()) != -1) fos.write(oneByte);
+
+ byte[] bytes = new byte[512];
+ int readResult;
+ while ((readResult = bis.read(bytes)) != -1) fos.write(bytes, 0, readResult);
} catch (IOException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
@@
-124,7
+129,7
@@
public class WebdavClient {
*/
Log.i(TAG, "Uploading, done");
} catch (final Exception e) {
*/
Log.i(TAG, "Uploading, done");
} catch (final Exception e) {
- Log.i(TAG,
e.getLocalized
Message());
+ Log.i(TAG,
""+e.get
Message());
result = false;
}
result = false;
}