Fix file not being sent
This commit is contained in:
parent
43ccfe5901
commit
5f0d2ea7b1
1 changed files with 5 additions and 2 deletions
|
@ -15,6 +15,7 @@ public class FileMessage extends Message {
|
|||
|
||||
private final String fileName;
|
||||
private String path;
|
||||
byte[] rawFile = null;
|
||||
|
||||
/**
|
||||
* Constructs a FileMessage
|
||||
|
@ -84,8 +85,10 @@ public class FileMessage extends Message {
|
|||
}
|
||||
|
||||
// write to the file
|
||||
FileInputStream stream = new FileInputStream(fileName);
|
||||
byte[] rawFile = stream.readAllBytes();
|
||||
if (rawFile == null) {
|
||||
FileInputStream stream = new FileInputStream(fileName);
|
||||
rawFile = stream.readAllBytes();
|
||||
}
|
||||
|
||||
FileOutputStream ostream = new FileOutputStream(file);
|
||||
ostream.write(rawFile);
|
||||
|
|
Loading…
Reference in a new issue