createOutputStream(): allow to disable decryption
This commit is contained in:
parent
ef98a24bf6
commit
cae124d93f
|
@ -53,20 +53,11 @@ public class AbstractConnectionManager {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
public static OutputStream createAppendedOutputStream(DownloadableFile file) {
|
||||
return createOutputStream(file, true);
|
||||
}
|
||||
|
||||
public static OutputStream createOutputStream(DownloadableFile file) {
|
||||
return createOutputStream(file, false);
|
||||
}
|
||||
|
||||
private static OutputStream createOutputStream(DownloadableFile file, boolean append) {
|
||||
public static OutputStream createOutputStream(DownloadableFile file, boolean append, boolean decrypt) {
|
||||
FileOutputStream os;
|
||||
try {
|
||||
os = new FileOutputStream(file, append);
|
||||
if (file.getKey() == null) {
|
||||
if (file.getKey() == null || !decrypt) {
|
||||
return os;
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
|
|
|
@ -213,7 +213,7 @@ public class JingleConnection implements Transferable {
|
|||
}
|
||||
this.file.getParentFile().mkdirs();
|
||||
this.file.createNewFile();
|
||||
this.mFileOutputStream = AbstractConnectionManager.createOutputStream(this.file);
|
||||
this.mFileOutputStream = AbstractConnectionManager.createOutputStream(this.file, false, true);
|
||||
return this.mFileOutputStream;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue