aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java')
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java
index d8bb0c21d..54e9bd205 100644
--- a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java
+++ b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java
@@ -5,6 +5,7 @@ import android.util.Log;
import android.util.Pair;
import java.io.FileNotFoundException;
+import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
@@ -157,7 +158,14 @@ public class JingleConnection implements Transferable {
return this.mFileInputStream;
}
- public OutputStream getFileOutputStream() {
+ public OutputStream getFileOutputStream() throws IOException {
+ if (this.file == null) {
+ Log.d(Config.LOGTAG, "file object was not assigned");
+ return null;
+ }
+ this.file.getParentFile().mkdirs();
+ this.file.createNewFile();
+ this.mFileOutputStream = AbstractConnectionManager.createOutputStream(this.file, message.getEncryption() == Message.ENCRYPTION_AXOLOTL);
return this.mFileOutputStream;
}
@@ -463,7 +471,6 @@ public class JingleConnection implements Transferable {
this.file.setKeyAndIv(key);
}
}
- this.mFileOutputStream = AbstractConnectionManager.createOutputStream(this.file, message.getEncryption() == Message.ENCRYPTION_AXOLOTL);
this.file.setExpectedSize(size);
message.resetFileParams();
Log.d(Config.LOGTAG, "receiving file: expecting size of " + this.file.getExpectedSize());