1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-11 10:09:38 +02:00

S5B Works now in both directions and with external proxy

This commit is contained in:
vanitasvitae 2017-06-28 14:48:39 +02:00
parent d537463a42
commit a395b11ee9
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 35 additions and 16 deletions

View file

@ -42,8 +42,8 @@ public class SendTask implements Runnable {
@Override
public void run() {
InputStream inputStream;
OutputStream outputStream;
InputStream inputStream = null;
OutputStream outputStream = null;
try {
inputStream = new FileInputStream(source);
@ -56,15 +56,21 @@ public class SendTask implements Runnable {
throw new IOException("Read returned -1");
}
LOGGER.log(Level.INFO, "WRITE");
outputStream.write(filebuf);
outputStream.flush();
LOGGER.log(Level.INFO, "WRITING FINISHED");
}
catch (IOException e) {
LOGGER.log(Level.SEVERE, "Could not send file: " + e, e);
}
finally {
try {
session.close();
if (inputStream != null) {
inputStream.close();
LOGGER.log(Level.INFO, "InputStream closed.");
}
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Could not close session.", e);
}