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 final String fileName;
|
||||||
private String path;
|
private String path;
|
||||||
|
byte[] rawFile = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructs a FileMessage
|
* Constructs a FileMessage
|
||||||
|
@ -84,8 +85,10 @@ public class FileMessage extends Message {
|
||||||
}
|
}
|
||||||
|
|
||||||
// write to the file
|
// write to the file
|
||||||
FileInputStream stream = new FileInputStream(fileName);
|
if (rawFile == null) {
|
||||||
byte[] rawFile = stream.readAllBytes();
|
FileInputStream stream = new FileInputStream(fileName);
|
||||||
|
rawFile = stream.readAllBytes();
|
||||||
|
}
|
||||||
|
|
||||||
FileOutputStream ostream = new FileOutputStream(file);
|
FileOutputStream ostream = new FileOutputStream(file);
|
||||||
ostream.write(rawFile);
|
ostream.write(rawFile);
|
||||||
|
|
Loading…
Reference in a new issue