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