code cleanup in jingle socks5 transport

This commit is contained in:
Daniel Gultsch 2016-06-24 13:36:37 +02:00
parent 78e3afc1af
commit 97fe14c4be

View file

@ -75,8 +75,6 @@ public class JingleSocks5Transport extends JingleTransport {
SocksSocketFactory.createSocksConnection(socket,destination,0); SocksSocketFactory.createSocksConnection(socket,destination,0);
isEstablished = true; isEstablished = true;
callback.established(); callback.established();
} catch (UnknownHostException e) {
callback.failed();
} catch (IOException e) { } catch (IOException e) {
callback.failed(); callback.failed();
} }
@ -117,13 +115,7 @@ public class JingleSocks5Transport extends JingleTransport {
if (callback != null) { if (callback != null) {
callback.onFileTransmitted(file); callback.onFileTransmitted(file);
} }
} catch (FileNotFoundException e) { } catch (Exception e) {
Log.d(Config.LOGTAG, connection.getAccount().getJid().toBareJid() + ": "+e.getMessage());
callback.onFileTransferAborted();
} catch (IOException e) {
Log.d(Config.LOGTAG, connection.getAccount().getJid().toBareJid() + ": "+e.getMessage());
callback.onFileTransferAborted();
} catch (NoSuchAlgorithmException e) {
Log.d(Config.LOGTAG, connection.getAccount().getJid().toBareJid() + ": "+e.getMessage()); Log.d(Config.LOGTAG, connection.getAccount().getJid().toBareJid() + ": "+e.getMessage());
callback.onFileTransferAborted(); callback.onFileTransferAborted();
} finally { } finally {
@ -177,13 +169,7 @@ public class JingleSocks5Transport extends JingleTransport {
fileOutputStream.close(); fileOutputStream.close();
file.setSha1Sum(CryptoHelper.bytesToHex(digest.digest())); file.setSha1Sum(CryptoHelper.bytesToHex(digest.digest()));
callback.onFileTransmitted(file); callback.onFileTransmitted(file);
} catch (FileNotFoundException e) { } catch (Exception e) {
Log.d(Config.LOGTAG, connection.getAccount().getJid().toBareJid() + ": "+e.getMessage());
callback.onFileTransferAborted();
} catch (IOException e) {
Log.d(Config.LOGTAG, connection.getAccount().getJid().toBareJid() + ": "+e.getMessage());
callback.onFileTransferAborted();
} catch (NoSuchAlgorithmException e) {
Log.d(Config.LOGTAG, connection.getAccount().getJid().toBareJid() + ": "+e.getMessage()); Log.d(Config.LOGTAG, connection.getAccount().getJid().toBareJid() + ": "+e.getMessage());
callback.onFileTransferAborted(); callback.onFileTransferAborted();
} finally { } finally {