diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-10-14 01:06:45 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-10-14 01:06:45 +0200 |
commit | bbb0693f4a9a62a872b61b12a5118b01c7ca9450 (patch) | |
tree | 7db16c0083e42461921936344fba1f9af7c58f97 /src/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java | |
parent | 7e373bc89fd11cf214fb435f25063d77cc2c48ae (diff) |
basic image over http downloading
Diffstat (limited to '')
-rw-r--r-- | src/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java b/src/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java index 63f5a5078..ec6b2c24a 100644 --- a/src/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java +++ b/src/eu/siacs/conversations/xmpp/jingle/JingleSocks5Transport.java @@ -10,6 +10,7 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Arrays; +import eu.siacs.conversations.DownloadableFile; import eu.siacs.conversations.utils.CryptoHelper; public class JingleSocks5Transport extends JingleTransport { @@ -86,7 +87,7 @@ public class JingleSocks5Transport extends JingleTransport { } - public void send(final JingleFile file, + public void send(final DownloadableFile file, final OnFileTransmissionStatusChanged callback) { new Thread(new Runnable() { @@ -96,7 +97,7 @@ public class JingleSocks5Transport extends JingleTransport { try { MessageDigest digest = MessageDigest.getInstance("SHA-1"); digest.reset(); - fileInputStream = getInputStream(file); + fileInputStream = file.createInputStream(); if (fileInputStream == null) { callback.onFileTransferAborted(); return; @@ -132,7 +133,7 @@ public class JingleSocks5Transport extends JingleTransport { } - public void receive(final JingleFile file, + public void receive(final DownloadableFile file, final OnFileTransmissionStatusChanged callback) { new Thread(new Runnable() { @@ -145,7 +146,7 @@ public class JingleSocks5Transport extends JingleTransport { socket.setSoTimeout(30000); file.getParentFile().mkdirs(); file.createNewFile(); - OutputStream fileOutputStream = getOutputStream(file); + OutputStream fileOutputStream = file.createOutputStream(); if (fileOutputStream == null) { callback.onFileTransferAborted(); return; |